Posts

Showing posts with the label UpdatePanel

Update Panel - Handle async partial-page state with client script

This is a sample script you can put at the master page. So that you dont need to have updatepanel progress every time you add the update panel in you aspx page. Script  <div id="pageUpdating"></div>     <script type="text/javascript">         Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);         function BeginRequestHandler(sender, args) {             //page is begin request, you can put code to lock screen etc.               writePageLoading();         }         Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler)         function endRequestHandler(sender, args) {             //page load successfully , end request               RemoveLoading();             if (args.get_error() != undefined && args.get_error().httpStatusCode == '500') {                 //if have error                 var errorMessage = args.get_error().message;                 alert(errorMessage + &qu

Integrate Timer with UpdatePanel to async page update - ASP.NET

Image
The Example show integration Timer with UpdatePanel to update page asynchronously. The ASPX Page   <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <!-- Interval time 5000 will be 5 second --> <asp:Timer ID="Timer1" runat="server" Interval="5000" ontick="Timer1_Tick"> </asp:Timer> <asp:Label ID="Label1" runat="server"></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /> </Triggers> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" Displa