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>//////////////