How do I display a Progress Bar an example - AspNet
Display progress bar after button click in Asp .Net
A simple progress bar let the user know that something is happening in background. In this post I will explain how to add Ajax Progress Bar in asp.net, find the source code below:-
Default.aspx
<%@ Page Language="C#"
AutoEventWireup="true"
CodeFile="UsingUpdateProgress.aspx.cs"
Inherits="_Default" %>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Display
Progress using UpdateProgress - Sample</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdateProgress ID="updProgress" AssociatedUpdatePanelID="UpdatePanel1" runat="server">
<ProgressTemplate>
<img alt="progress" src="images/progress.gif" />
Processing...
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="lblText" runat="server" Text=""></asp:Label>
<br />
<br />
<asp:Button ID="btnInvoke" runat="server" Text="Click" OnClick="btnInvoke_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
Default.cs
using System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object
sender, EventArgs e)
{
}
protected void btnInvoke_Click(object
sender, EventArgs e)
{
// Do some
processing here
System.Threading.Thread.Sleep(3000);
lblText.Text = "Processing
completed successfully";
}
}
Download the source code click here ..
How do I display a Progress Bar an example - AspNet
Reviewed by Ravi Kumar
on
4:16 PM
Rating:

No comments: