ASP 101 - Active Server Pages 101 - Web05
The Place ASP Developers Go!

Please visit our partners


Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash





Script Output:

Progress Bars

HTML Table Version:

  

IE-esque Solid Version:

65.37%34.63%

Generic Blue/Grey Version:

65.37%34.63%

IE Version:

65.37%65.37%65.37%65.37%65.37%65.37%65.37%65.37%65.37%65.37%65.37%34.63%34.63%34.63%34.63%34.63%34.63%

Classic Version:

65.37%65.37%65.37%65.37%65.37%65.37%65.37%65.37%65.37%34.63%34.63%34.63%34.63%34.63%


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

0%100% 0% @ 100px

25%75% 25% @ 150px

50%50% 50% @ 200px

75%25% 75% @ 250px

100%0% 100% @ 300px

ASP HTML Download            FAQ

ASP.NET Version

Unfortunately, we all know what progress bars are. As annoying as it is to sit and stare at one, it's better then sitting there waiting for a program to do something without knowing if it's frozen or not. While HTTP doesn't offer the same level of interactivity as a desktop application, there are still instances where a progress bar type display can be useful. One example that comes to mind is displaying the amount of used space on a server's hard drive. Anyway... if you're here you probably already know what you want to use it for... now to the code.

While the different versions are relatively similar, they do fall into two different categories which I (for lack of better terms) will call smooth and chunked. The smooth ones are simpler in concept. Simply stretch an HTML element or image to the correct size and that's it. The chunked ones end up being less precise and require a little bit of calculation to determine how many of the "chunks" should be filled and how many should be empty.

Since they're all fundamentally the same, I was going to wrap all the different versions into one subroutine, but since most people will probably choose the one they like and discard the rest, keeping them in independent subs seemed to make more sense.

The images used in this sample can be downloaded from here: progressbar_images.zip (3 KB)


Samples

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers