With an Update Progress control, you can show the status during the partial-page rendering of an UpdatePanel.
Syntax:
<asp:UpdateProgressID="UpdateProgress1"runat="server">
</asp:UpdateProgress>
Code:
Write these codes on aspx page
<%-- ScriptManager control manages client script for AJAX enabled ASP.NET pages--%>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdateProgress runat="server" id="PageUpdateProgress">
<%--ProgressTemplate Property sets the template that defines the content of the UpdateProgress control.--%>
<ProgressTemplate>
Loading...
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel runat="server" id="Panel">
<%--You need to place content of the page that you want to be in the UpdatePanel inside this--%>
<ContentTemplate>
<asp:Button runat="server" id="UpdateButton" onclick="UpdateButton_Click" text="Update Time" />
<asp:Label ID="Label1" runat="server"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
Write these code on button click
protected void UpdateButton_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(3000);
Label1.Text = DateTime.Now.ToString();
}
Run the Project
When you click Update Time button then it shows the status during the partial-page rendering of an UpdatePanel.
Anonymous User
26-Feb-2019Thank You for the post.
Samuel Fernandes
28-Jul-2017It was really helpful to read this post.