In Windows Forms it is very easy to pop up a status message by calling MessageBox.Show(“message”). It is that kind of object model we want in ASP.NET for printing out JavaScript alerts. We want Alert.Show(“message”) in ASP.NET.
JavaScript: Alert.Show(”message”) from ASP.NET code-behind
Simple and Elegant. Makes you wonder why somthing like this was not included with ASP.NET 2.0.
1 comment:
'ASP.net MessageBox
'Add a scriptmanager to the ASP.Net Page
try:
Dim sMsg As String = "My Message"
ScriptManager.RegisterStartupScript(Page, Page.GetType, Guid.NewGuid().ToString(), "alert('" & sMsg & "')", True)
Post a Comment