asp.net AJAX regularly refresh the page, and then, in the pop-up window Timer event

The following is the aspx Code:

ContractedBlock.gif ExpandedBlockStart.gif Code
 1None.gif<body>
 2None.gif    <form id="form1" runat="server">
 3None.gif        <asp:ScriptManager ID="ScriptManager1" runat="server" />
 4None.gif        <div>
 5None.gif            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
 6None.gif
 7None.gif                <ContentTemplate>
 8None.gif                    <asp:Timer ID="Timer1" runat="server" Interval="5000" OnTick="Timer1_Tick">
 9None.gif                    </asp:Timer>
10None.gif                </ContentTemplate>    
11None.gif            </asp:UpdatePanel>
12None.gif            </div>
13None.gif    </form>
14None.gif</body>

The following is aspx.CS Code:

ContractedBlock.gif ExpandedBlockStart.gif Code
1None.gifprotected void Timer1_Tick(object sender, EventArgs e)
2ExpandedBlockStart.gifContractedBlock.gif    dot.gif{
3InBlock.gif        
4InBlock.gif            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);
5InBlock.gif          //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     }InBlock.gif          
ExpandedBlockEnd.gif

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

Guess you like

Origin blog.csdn.net/weixin_33951761/article/details/93495964