Summary of several methods of ASP. NET Alert Popup message

Source: Internet
Author: User
1.clientscript.registerstartupscript (GetType (), "message", "<script>alert (' The first way, no white screen! ');</script> ");

2.httpcontext.current.response.write ("<script>alert (' The second way, there white screen! ') </script> ");

3.public static void Show (System.Web.UI.Page Page, String msg)
{
Page. Clientscript.registerstartupscript (page. GetType (), "message", "<script language= ' JavaScript ' Defer>alert ('" + MSG. ToString () + "');</script>");
}
Show (This, "The third Way, no white screen, no distortion! ");

4.response.write ("<script>alert (' Fourth Way, there white screen! ') </script> ");

5.window.showmodaldialog (' xxx.aspx ', ', ' Dialogwidth:429px;dialogheight:200px;location:no,menubar:no,toolbar:no , Status:no ');

6.page.clientscript.registerstartupscript (This.gettype (), "", "<script>window.open ('. /issue/issueallcomment.aspx ');</script> ");
can be resolved.

7.
The functions that use AJAX components are as follows:
System.Web.UI.ScriptManager.RegisterStartupScript (this, this.) GetType (), "Opennewwindow", "alert (' Pop-up box content! '); ", true);

8.
Place a control on the last line of the body of the page and assign a value to the control in the code page, such as:

Label. text= "<script>alert (' pop-up box content! ); </script> ";

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.