ASP.NET AJAX UpdateProgress Control
In this example, i have shown how to use Update Progress outside of the Update Panel. We can use update progress inside of outside of the update panel.Update Panel is having content template, which is having Ajax related operations controls. If i click on the below output button, this button will asynchronously call the btnSubmit_Click event which is server side code. Here page is not refreshing, just update panel portion is making asynchronous call to the server.
This is one of the good ASP.NET Interview Questions.
Output:
ASP.NET AJAX UpdateProgress Control Example with UpdatePanel |
ASP.NET Code:
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void btnSubmit_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(2000); } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <table style="height:300px;width:400px" border="1"> <tr> <td valign="top" style="width:80%"> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Button ID="btnSubmit" runat="server" Text="Submit" onclick="btnSubmit_Click" /> <br /><br /> </ContentTemplate> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" runat="server"> <ProgressTemplate> <img src="ajax-loader.gif" alt="Ajax " />Loading... </ProgressTemplate> </asp:UpdateProgress> </td> <td> This is static data. </td> </tr> </table> </div> </form> </body> </html>
Post a Comment
Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.