[转载]AJAX UpdateProgressBar
AJAX UpdateProgressBar
文章作者:Munir Shaikh
信息来源:邪恶八进制信息安全团队( www.eviloctal.com)
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;
}
}
文章作者:Munir Shaikh
信息来源:邪恶八进制信息安全团队( www.eviloctal.com)
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;
}
}