The following is the aspx Code:
Code
1<body>
2 <form id="form1" runat="server">
3 <asp:ScriptManager ID="ScriptManager1" runat="server" />
4 <div>
5 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
6
7 <ContentTemplate>
8 <asp:Timer ID="Timer1" runat="server" Interval="5000" OnTick="Timer1_Tick">
9 </asp:Timer>
10 </ContentTemplate>
11 </asp:UpdatePanel>
12 </div>
13 </form>
14</body>
1<body>
2 <form id="form1" runat="server">
3 <asp:ScriptManager ID="ScriptManager1" runat="server" />
4 <div>
5 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
6
7 <ContentTemplate>
8 <asp:Timer ID="Timer1" runat="server" Interval="5000" OnTick="Timer1_Tick">
9 </asp:Timer>
10 </ContentTemplate>
11 </asp:UpdatePanel>
12 </div>
13 </form>
14</body>
The following is aspx.CS Code:
Code
1protected void Timer1_Tick(object sender, EventArgs e)
2 {
3
4 ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, UpdatePanel1.GetType(), "error", "window.showModalDialog('Pop.aspx', 'newwindow', 'dialogWidth:400px;DialogHeight=300px;center: yes;help:no;resizable:no;status:no');", true);
5 //ScriptManager.RegisterClientScriptBlock (this.UpdatePanel1, UpdatePanel1.GetType (), "error", "window.open ( 'Pop.aspx', 'newwindow', 'height = 450, width = 550, top = 120, left = 250, = NO Toolbar, MenuBar = NO, NO = scrollbars, resizable = NO, LOCATION = NO, NO Status = '); ", to true);
. 6 // ScriptManager.RegisterStartupScript (UpdatePanel1, UpdatePanel1.GetType ()," "," alert ( 'Tip:! product added successfully'); if (confirm ( ' ? continue to add cancel product management page')) {alert ( 'this page continues to add')} else {open ( ' productManage.aspx' , '_ Self');} ", to true); . 7 }
1protected void Timer1_Tick(object sender, EventArgs e)
2 {
3
4 ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, UpdatePanel1.GetType(), "error", "window.showModalDialog('Pop.aspx', 'newwindow', 'dialogWidth:400px;DialogHeight=300px;center: yes;help:no;resizable:no;status:no');", true);
5 //ScriptManager.RegisterClientScriptBlock (this.UpdatePanel1, UpdatePanel1.GetType (), "error", "window.open ( 'Pop.aspx', 'newwindow', 'height = 450, width = 550, top = 120, left = 250, = NO Toolbar, MenuBar = NO, NO = scrollbars, resizable = NO, LOCATION = NO, NO Status = '); ", to true);
. 6 // ScriptManager.RegisterStartupScript (UpdatePanel1, UpdatePanel1.GetType ()," "," alert ( 'Tip:! product added successfully'); if (confirm ( ' ? continue to add cancel product management page')) {alert ( 'this page continues to add')} else {open ( ' productManage.aspx' , '_ Self');} ", to true); . 7 }
aspx.CS in:
The first method is the pop-up window with the modal method showModalDialog
The second method is to use window.open pop-up window
The third method is an example of a popup window, and then performs various different results confirmed
Reproduced in: https: //www.cnblogs.com/zhangchenliang/archive/2008/03/04/1090388.html