Asp.Net alert pop up message summary of several methods
- 2020-03-30 01:37:00
- OfStack
1. ClientScript. RegisterStartupScript (GetType (), "the message," "< Script> Alert (' first way, no white screen! '); < / script>" );
2. HttpContext. Current. The Response. Write (" < Script> Alert (' second way, white screen! ') < / script>" );
3. Public static void Show(system.web.ui.page, string MSG)
{
Page. ClientScript. RegisterStartupScript (page. GetType (), "the message," "< Script language = 'javascript' defer> Alert ('" + msg.ToString() + "'); < / script>" );
}
Show(this, "third way, no white screen, no distortion!" );
4. The Response. Write (" < Script> Alert (' fourth way, white screen! ') < / script>" );
5. Window. ShowModalDialog (' XXX. Aspx ', ' ', 'dialogWidth: 429 px; DialogHeight: 200 px; Location: menubar: no, no, the toolbar: status: no, no, ');
6. Page. Clientscript. Registerstartupscript (enclosing gettype (), ""," < Script> Window. The open ('.. / issue/issueallcomment. Aspx '); < / script>" );
Can be solved.
7.
Functions that use ajax components are as follows:
System. Web. UI. ScriptManager. RegisterStartupScript (this, enclosing GetType (), "opennewwindow", "alert (' pop-up box content! ');" , true);
8.
Place a control on the last line of the body of the page and assign it a value in the code page, such as:
Label. The Text = "< Script> Alert (' pop-up content!) ; < / script> ";