<% '******************************************************* '* ASP 101 Sample Code - http://www.asp101.com/ * '* * '* This code is made available as a service to our * '* visitors and is provided strictly for the * '* purpose of illustration. * '* * '* http://www.asp101.com/samples/license.asp * '* * '* Please direct all inquiries to webmaster@asp101.com * '******************************************************* %> <% Sub DisplayProgressBarHtmlTable(sglPercentComplete, intWidth) Dim intBarLength If 0 <= sglPercentComplete And sglPercentComplete <= 100 Then ' Compensate for the width of the table border intBarLength = intWidth - 4 Response.Write "
" Response.Write "" Response.Write "" Response.Write "
  
" Response.Write "
" End If End Sub Sub DisplayProgressBarIEesque(sglPercentComplete, intWidth) Dim intBarLength If 0 <= sglPercentComplete And sglPercentComplete <= 100 Then ' Compensate for the width of the two end images intBarLength = intWidth - 8 Response.Write "" Response.Write "" Response.Write "" Response.Write "" End If End Sub Sub DisplayProgressBarBlueGrey(sglPercentComplete, intWidth) Dim intBarLength If 0 <= sglPercentComplete And sglPercentComplete <= 100 Then ' Compensate for the width of the two end images intBarLength = intWidth - 6 Response.Write "" Response.Write "" Response.Write "" Response.Write "" End If End Sub Sub DisplayProgressBarIE(sglPercentComplete, intNumberOfChunks) Dim intFilledChunks Dim I If 0 <= sglPercentComplete And sglPercentComplete <= 100 Then intFilledChunks = Round(sglPercentComplete * intNumberOfChunks / 100) Response.Write "" For I = 1 To intNumberOfChunks If I <= intFilledChunks Then Response.Write "" Else Response.Write "" End If Next Response.Write "" End If End Sub Sub DisplayProgressBarClassic(sglPercentComplete, intNumberOfChunks) Dim intFilledChunks Dim I If 0 <= sglPercentComplete And sglPercentComplete <= 100 Then intFilledChunks = Round(sglPercentComplete * intNumberOfChunks / 100) Response.Write "" For I = 1 To intNumberOfChunks If I <= intFilledChunks Then Response.Write "" Else Response.Write "" End If Next Response.Write "" End If End Sub %>

Progress Bars

HTML Table Version:

<% DisplayProgressBarHtmlTable 65.37, 150 %>

IE-esque Solid Version:

<% DisplayProgressBarIEesque 65.37, 150 %>

Generic Blue/Grey Version:

<% DisplayProgressBarBlueGrey 65.37, 150 %>

IE Version:

<% DisplayProgressBarIE 65.37, 17 %>

Classic Version:

<% DisplayProgressBarClassic 65.37, 14 %>


Note: It's simple to change the percentage and bar length:

<% DisplayProgressBarIEesque 0, 100 %> 0% @ 100px

<% DisplayProgressBarIEesque 25, 150 %> 25% @ 150px

<% DisplayProgressBarIEesque 50, 200 %> 50% @ 200px

<% DisplayProgressBarIEesque 75, 250 %> 75% @ 250px

<% DisplayProgressBarIEesque 100, 300 %> 100% @ 300px