C #, the pop-up window code is:
MessageBox ("incorrect user name or password! "," Error :");
In Asp.net, this method cannot be used. In this case, we can write a class Message (the name can be obtained at Will) with the following content:
Using System;
Namespace Common
{
/// <Summary>
/// Message summary.
/// </Summary>
Public class Message
{
Public Message ()
{
//
// TODO: add the constructor logic here
//
}
// Return to a pop-up window
Public static string Show (string strMsg)
{
// Here 0 refers to strMsg, and 1 refers to it.
Return String. format ("<script language = {1} javascript {1}> alert ({1} {0} {1}); </script>", strMsg, """);
}
}
}
Then, add a label control on the page where the dialog box is to be displayed. Assume that the control is named lblMsg. Then, write the code in the background:
LblMsg. Text = Message. Show ("content to be popped out here ");
In this way, the effects of the pop-up prompt can be realized. Note that my class is written in the general layer, so you must first reference the General layer:
Using Common;