In this tutorial, we learn how to add UpdateProgress control in ASP.Net web page and also how to associate UpdateProgress control to specific UpdatePanel in Asp.Net
First, you have to add UpdatePanel in ASP.Net web page.
Now add UpdateProgress Control like below:
You can also specify gif loading image like below:
In above example, UpdateProgress control can associate with all UpdatePanel Control in Web Page.
If you want to specify UpdateProgress Control to to specific UpdatePanel then you have to add AssociatedUpdatePanelID attribute with UpdatePanel ID as below:
The Complete Example Code as Below:
Demo
Download Complete Source Code
First, you have to add UpdatePanel in ASP.Net web page.
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
//add Controls and content
</ContentTemplate>
</asp:UpdatePanel>
Now add UpdateProgress Control like below:
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<span style="color: Red; font-weight: bold;">Processing... </span>
</ProgressTemplate>
</asp:UpdateProgress>
You can also specify gif loading image like below:
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<asp:Image ID="Image1" ImageUrl="loading.gif" runat="server" />
</ProgressTemplate>
</asp:UpdateProgress>
In above example, UpdateProgress control can associate with all UpdatePanel Control in Web Page.
If you want to specify UpdateProgress Control to to specific UpdatePanel then you have to add AssociatedUpdatePanelID attribute with UpdatePanel ID as below:
<asp:UpdateProgress AssociatedUpdatePanelID="UpdatePanel1" ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<span style="color: Red; font-weight: bold;">Processing... </span>
</ProgressTemplate>
</asp:UpdateProgress>
The Complete Example Code as Below:
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table>
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Email"></asp:Label>
</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text="Password"></asp:Label>
</td>
<td>
<asp:TextBox ID="TextBox2" runat="server" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Button ID="Button1" runat="server" Text="Log In" OnClick="Button1_Click" />
<asp:UpdateProgress AssociatedUpdatePanelID="UpdatePanel1" ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<span style="color: Red; font-weight: bold;">Processing... </span>
</ProgressTemplate>
</asp:UpdateProgress>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
Demo
Download Complete Source Code
0 comments:
Post a Comment