Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Classic ASP Page Framework

The other day I asked a question on a list about the perf. Implications of using VBScript classes in classic ASP applications.  After participating in that thread I was reminded that, a while back I actually wrote an object oriented, event-driven classic ASP Page model which mimics some of the services which are built into the ASP.NET pages - such as Authentication, Users/Identities and Page properties.  The page automagically serializes it's state (which could be abstracted by implementing a Provider model).  The model also contained an in-built AuthenticationProvider which handles re-directs when secured resources are requested.

The whole framework weighed in at less than 350 lines of code!  You can see the code for it here:

    http://flws.com.au/AuthenticateModel.html

For me one of the big things about abstracting things into object models is that, because people relate to objects well object - such as Person.MiddleName - they enable you to easily build robust frameworks by pushing essential services down a layer.  It's only through building reliable frameworks that you can achieve true manageability - especially when project sizes need to be be scalable.

5 Comments

  • You might know this, but Andy Smith developed a very nice Classic ASP framework a number of years ago. It ended up as a compiled COM object. I forget if it had authentication or not, but the ViewState, postback events, and all sorts of fun stuff was in there.



    And of course, Andy being Andy, he developed a slew of databound web controls. Even an editable datagrid! Everything used xml and xslt for rendering.



    It was a lot of fun to work with. I used it for probably a year, just before .Net came out.

  • Hi Christian, I think that the coolest part of my framework is its simplicity. As I wrote earlier, it's about 350 lines of code and has the essentials needed to implement User, Page, Roles and Authentication.



    I presume that yours is much more complete (and therefore much larger) than this; I'll see if I can read up on your article at CodeProject.

  • Something I forgot. The sample site is old and used v1.8. v2.0 is way better and faster and its event model was enhanced and expanded to resemble even more ASP.NET :-P

  • Thanks for the feedback Christian, your framework sounds very cool. I know how something like this can turn into a labour of love - which yours seems to have :-)



    I deliberately kept the scope of mine minimal so that I just had something which added a small amount of value; after that I pretty much stopped writing ASP applications. Had I continued with classic ASP though, I have no doubt that I would have needed to do a similar thing to what you've done because, as you say, .NET taught us the importance of being able to rapidly develop from a stable base of controls and services.



    As I said, I'll take a look at your stuff and recommend it to any classic ASP'ers that I come across.

  • Thanks Darren.



    You are very right in that something you didn't expect to be a big deal can become sort of something addictive/ a passion that can take some (a lot) of your time...



    I just hope that it is of use to some people... anyway it was fun doing it and I learned a lot the "why" of the way many things were done in ASP.NET...

Comments have been disabled for this content.