ASP.NET Version of "Progress Bar"

ASP.NET version of "Progress Bar"


This sample uses ASP.NET to create a progress bar type of display for use on a web page. It is implemented as a user control so that it's extremely simple to use. I've included five different styles implemented three different ways so you can choose whatever style you prefer.

When I started writing the ASP.NET version of our progress bar sample, I had some decisions to make. First off, ASP.NET includes plenty of graphical capabilities that classic ASP does not. This means that if we wanted to, we could generate the entire progress bar using ASP.NET and remove the reliance on the included images. I decided against this approach in order to keep things simple and to avoid adding any additional server processing.

The next decision was how to implement the actual code. It made sense to wrap things up into a user control, but with three different types of progress bar I didn't want things to get too confusing. I did decide to roll all three types (HTML, Smooth, and Chunked) into one control. To keep things simple I created a separate function to build each type. They're all pretty similar, but the details vary enough to make integrating them difficult. The Page_Load routine acts as a traffic cop of sorts and directs execution to the appropriate function based upon the style choosen.

Creating a new style is as simple as creating a new set of images, deciding on a name, and setting some properties in the control. If you take a look at the existing styles you'll see what I mean.

One last note: since the "IE-esque" style has the least user-friendly name, I've made it the default style. Any time the control is passed an unrecognized style name, it reverts back to the "IE-esque" style.

A zip file of the code (including the control and related images) (6.1 KB) is below.



About the Author

From ASP101

Articles originally posted on ASP101.com

Downloads

Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Today's agile organizations pose operations teams with a tremendous challenge: to deploy new releases to production immediately after development and testing is completed. To ensure that applications are deployed successfully, an automatic and transparent process is required. We refer to this process as Zero Touch Deployment™. This white paper reviews two approaches to Zero Touch Deployment--a script-based solution and a release automation platform. The article discusses how each can solve the key …

  • On-demand Event Event Date: December 18, 2014 The Internet of Things (IoT) incorporates physical devices into business processes using predictive analytics. While it relies heavily on existing Internet technologies, it differs by including physical devices, specialized protocols, physical analytics, and a unique partner network. To capture the real business value of IoT, the industry must move beyond customized projects to general patterns and platforms. Check out this webcast and join industry experts as …

Most Popular Programming Stories

More for Developers

RSS Feeds