There are many ways to play the box in Asp.net:
1. Basic Methods:
Response. Write ("<SCRIPT> alert ('bullet box! ') </SCRIPT> ");
2. When the scriptmanager control is available on the page:
Page. clientscript. registerstartupscript (page. GetType (), "<SCRIPT> alert ('pop-up box! '); </SCRIPT> ");
3. After adding, deleting, and modifying, a prompt is displayed, and you can jump to the following page:
Page. clientscript. registerstartupscript (page. GetType (), "<SCRIPT> alert ('Update successful! '); Window. Location. href ='Your URL'</SCRIPT> ");
4. Close the page after the pop-up page, execute add, delete, and modify prompts, and refresh the parent page:
Response. Write ("<SCRIPT> alert ('Update successful! '); Window. Close (this); window. opener. Location. href = Window. opener. Location. href; </SCRIPT> ");
5. When the page requires a lot of prompts, we can do a method by ourselves. You can specify the pop-up message when using it:
Method:
Public void alert (string MSG)
{
Stringbuilder SB1 = new
Stringbuilder ();
Sb1.append ("<SCRIPT> alert ('");
Sb1.append (MSG );
Sb1.append ("') </SCRIPT> ");
Page. registerstartupscript ("", sb1.tostring ());
}
Call:
Alert ("deleted successfully ");