日期:2014-05-18 浏览次数:20498 次
<asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="0" DynamicLayout="false"> <ProgressTemplate> <span style="color:Red">Loading...</span> </ProgressTemplate> </asp:UpdateProgress> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <%= DateTime.Now %><br /> <asp:Label ID="Label1" runat="server" Text=""></asp:Label><br /> <asp:Button ID="btnPrecedence" runat="server" Text="优先" OnClick="Button_OnClick" /> <asp:Button ID="Button2" runat="server" Text="普通" OnClick="Button_OnClick" /> </ContentTemplate> </asp:UpdatePanel> <script type="text/javascript" language="javascript"> var lastPostBackButtonId = null; var btnPrecedenceId = "<%= this.btnPrecedence.ClientID %>"; Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest( function(sender, e) { var prm = Sys.WebForms.PageRequestManager.getInstance(); if (prm.get_isInAsyncPostBack()) { if (lastPostBackButtonId == btnPrecedenceId) { e.set_cancel(true); if (e.get_postBackElement().id == btnPrecedenceId) { showMessage("不可重复发起优先的刷新。"); } else { showMessage("请等待优先的刷新结束。"); } return; } else if (e.get_postBackElement().id == btnPrecedenceId) { showMessage("发起优先的刷新,普通的刷新将被取消。"); } else { showMessage("重新发起普通的刷新,前一次提交将被取消。"); } } lastP