Events in the Asp.net bullet box

Source: Internet
Author: User

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 ");

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.