Hi friends, in this article I will explain about Ajax UpdateProgress Example in ASP.NET using C#/VB.NET.
I already explained in the previous articles about How to select all the Checkboxes in Gridview by clicking on Checkbox in HeaderText in ASP.NET using Javascript, How to select all the Checkboxes in Gridview by clicking on Checkbox in HeaderText in ASP.NET using Javascript and Ajax UpdatePanel Control Example in ASP.NET
In ASP.NET:
In C#.NET:
The output of the above code as shown in the below figure.
I already explained in the previous articles about How to select all the Checkboxes in Gridview by clicking on Checkbox in HeaderText in ASP.NET using Javascript, How to select all the Checkboxes in Gridview by clicking on Checkbox in HeaderText in ASP.NET using Javascript and Ajax UpdatePanel Control Example in ASP.NET
In ASP.NET:
<html xmlns="http://www.w3.org/1999/xhtml"
>
<head id="Head1"
runat="server">
<title>UpdateProgress
Example</title>
<style type="text/css">
#UpdatePanel1
{
width:500px; height:150px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1"
runat="server">
<ContentTemplate>
<fieldset>
<legend>Time</legend>
<asp:Label ID="Label1"
runat="server"
Text=''></asp:Label><br />
<asp:Button ID="GetTime"
runat="server"
Text="Button"
OnClick="GetTime_Click"
/>
<asp:GridView ID="GridView1"
runat="server">
</asp:GridView>
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1"
runat="server">
<ProgressTemplate>
<img src="images/loading_image.gif" alt=""/>
Processing...
</ProgressTemplate>
</asp:UpdateProgress>
</div>
</form>
</body>
</html>
|
In C#.NET:
using System;
using
System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using
System.Web.UI.WebControls;
public partial class UpdateProgress : System.Web.UI.Page
{
protected
void Page_Load(object
sender, EventArgs e)
{
Label1.Text = "Initial page rendered at" + DateTime.Now.ToString();
}
protected
void GetTime_Click(object
sender, EventArgs e)
{
System.Threading.Thread.Sleep(4000);
Label1.Text = "Page refreshed at " + DateTime.Now.ToString();
}
}
|
The output of the above code as shown in the below figure.
No comments:
Post a Comment