Click here to Skip to main content
15,886,199 members
Articles / Web Development / ASP.NET

A simple progress bar web user control

Rate me:
Please Sign up or sign in to vote.
4.60/5 (34 votes)
8 Sep 2003CPOL1 min read 260.5K   7K   92  
Lightweight HTML table based (no image) progress bar
Public Class WebForm1
    Inherits System.Web.UI.Page
    Protected WithEvents cmdSetProgress As System.Web.UI.WebControls.LinkButton
    Protected WithEvents txtProgress As System.Web.UI.WebControls.TextBox
    Protected WithEvents lblError As System.Web.UI.WebControls.Label
    Protected ProgressBar1 As ProgressBar

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
    End Sub

    Private Sub cmdSetProgress_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSetProgress.Click
        Try
            lblError.Text = ""
            ProgressBar1.SetProgress(txtProgress.Text, 100)
        Catch err As Exception
            lblError.Text = err.ToString()
        End Try
    End Sub
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
Steve is a software developer working in Minneapolis, MN.

Comments and Discussions