C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to create a progressbar in asp.net


Posted Date: 13 May 2008    Resource Type: Code Snippets    Category: C# Syntax
Author: Sadhana SinghMember Level: Gold    
Rating: Points: 10



The following code sample sample shows how to create a progressbar in asp.net

private int state = 0;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["State"] != null)
{
state = Convert.ToInt32(Session["State"].ToString());
}
else
{
Session["State"] = 0;
}
if (state > 0 && state <= 10)
{
this.lblMessages.Text = "Task undertaking!";
this.panelProgress.Width = state * 30;
this.lblPercent.Text = state * 10 + "%";
Page.RegisterStartupScript("", "");
}
if (state == 100)
{
this.panelProgress.Visible = false;
this.panelBarSide.Visible = false;
this.lblMessages.Text = "Task Completed!";
Page.RegisterStartupScript("", "");
}

}

////////////design view for progressbar///////////////
<form id="Form1" method="post" runat="server">
<asp:Label id="lblMessages" runat="server"></asp:Label>
<asp:Panel id="panelBarSide" runat="server" Width="300px" BorderStyle="Solid" BorderWidth="1px"
ForeColor="Silver">
<asp:Panel id="panelProgress" runat="server" Width="10px" BackColor="Green"></asp:Panel>
</asp:Panel>
<asp:Label id="lblPercent" runat="server" ForeColor="Blue"></asp:Label>
</form>//////////////




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How can we create or delete a folder using C#
Previous Resource: code for searching in grid view
Return to Discussion Resource Index
Post New Resource
Category: C# Syntax


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use