At times it may be necessary to show the user a message from various sections of code for reasons such as invalid data has been entered.
This is easily accomplished by using the folliowing code:
C#:
BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(this, "BUTTON_CLICK_MESSAGE", "Enter your exception message here.");
VB.NET:
BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", "Enter your exception message here.")
Or, if you want more control over the JavaScript alert, you can use the following code:
C#:
String ErrorScript = "alert('Enter your exception message here.');";
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "", ErrorScript, true);
VB.NET:
Dim ErrorScript As String = "alert('Enter your exception message here.');"
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "", ErrorScript, True)
Regards,
Dean
...