Why we need progressbars in any application?
We need progress bar to represent the status, current activity is being performed. It helps us to design more intuitive UI when web page contains one or more update panel controls for partial page rendering.
If a partial page update is slow you can use update progress control to provide visual feedback about the status of the update.
You can put multiple update progress controls on a page each associated with the different update panel control. To provide the visual feedback about the status of the object, here is simple code, which shows you that on button click Ajax updateprogress appear which displays rotating image, and at the backend process of connecting to the database and binding to the gridview appears.
I have simple table as below
Tbl_Projects:
ProjectId int,
ProjectName varchar(50),
Duration int,
Status char(1)
I have a static method in the sealed class as below:
public sealed class Util
{
public static DataSet ExecuteDataSet()
{
DataSet dtst = new DataSet();
SqlConnection SqlCon = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
SqlCommand SqlComd = new SqlCommand("SELECT * FROM Tbl_Projects", SqlCon);
SqlDataAdapter SqlAdpt = new SqlDataAdapter();
try
{
SqlAdpt.SelectCommand = SqlComd;
SqlAdpt.Fill(dtst);
}
catch
{ }
finally
{
SqlCon.Close();
}
return dtst;
}
}
Here is "Default.aspx" code, which is as follows:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">

Rohit KapoorPosted Sep 13, 2007, 5:10 AM
Hi I am using Ajax with masterpagges of .net 2005. When i use to add timer insideupdate pannel and put update pannel on masterpage or on its content page... timer use to post back the whole page not only update pannel.. why so please suggest. Regards Rohit