MessageBox does not exist in ASP.NET. If you need functionality in the browser, for example, displaying a message box, you need to select javascript . ASP.NET provides you with a javascript input tool that is rendered and executed when the html sent to the browser is loaded and displayed. You can use the following code in Page_Load, for example:
Type cstype = this.GetType(); // Get a ClientScriptManager reference from the Page class. ClientScriptManager cs = Page.ClientScript; // Check to see if the startup script is already registered. if (!cs.IsStartupScriptRegistered(cstype, "PopupScript")) { String cstext = "alert('Hello World');"; cs.RegisterStartupScript(cstype, "PopupScript", cstext, true); }
This sample is extracted from MSDN .
XIII
source share