Home > Backend Development > C#.Net Tutorial > Summary of several methods for Asp.Net alert to pop up prompt information

Summary of several methods for Asp.Net alert to pop up prompt information

高洛峰
Release: 2017-01-21 15:26:25
Original
2337 people have browsed it

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 is a white screen!')</script>");

3.public static void Show (System.Web.UI.Page page, string msg)
 {
   page.ClientScript.RegisterStartupScript(page.GetType(), "message", "");
}
Show(this, "The third method, no white screen, no deformation!");

4.Response.Write("<script>alert('The fourth way, there is a 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 solved.

7 .
Use the function of the ajax component as follows:
System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "opennewwindow", "alert('Pop-up box content!');", true);

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

label.Text="< script>alert('Pop-up box content! ;

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template