<asp:ScriptManager ID="scriptmanager" runat="server"></asp:ScriptManager> <script language="javascript" type="text/javascript"> // Get the instance of PageRequestManager. var prm = Sys.WebForms.PageRequestManager.getInstance(); // Add initializeRequest and endRequest prm.add_initializeRequest(prm_InitializeRequest); prm.add_endRequest(prm_EndRequest); // Called when async postback begins function prm_InitializeRequest(sender, args) { // get the divImage and set it to visible var panelProg = $get('divImage'); panelProg.style.display = ''; // reset label text var lbl = $get('<%= this.lblStatus.ClientID %>'); lbl.innerHTML = ''; // Disable button that caused a postback $get(args._postBackElement.id).disabled = true; } // Called when async postback ends function prm_EndRequest(sender, args) { // get the divImage and hide it again var panelProg = $get('divImage'); panelProg.style.display = 'none'; // Enable button that caused a postback $get(sender._postBackSettings.sourceElement.id).disabled = false; } </script> <tr><td align="center"> <asp:Button ID="btnsubmit" runat="server" Text="Submit" CssClass="buttons" onclick="btnsubmit_Click" CausesValidation="true" /> <asp:Button ID="btnreset" runat="server" Text="Reset" CssClass="buttons" CausesValidation="false" onclick="btnreset_Click" /> </td> <td> </td> </tr> <tr><td> <asp:Label ID="lblStatus" runat="server" ForeColor="Red"></asp:Label> <div id="divImage" style="display:none"> <asp:Image ID="img1" runat="server" ImageUrl="~/images/progress.gif" /> Sending... </div>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)