ASP/.NET Web Hosting
* 3 Months FREE *
CLICK HERE!
 CoverYourASP --> Object oriented ASP

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
65 active users
853 visitors today
929 pages today
(only part of today)
Tools I use

CoverYourASP
Copyright © 1999-2008 James Shaw.
All rights reserved.

ASP.NET Blog
RSS submissions
E-commerce

Now open source with SourceForge!

Some have called my page layout "object-oriented" with the Init, Header, Content and Footer functions, but it isn't really so.

In hindsight (which is always 20/20 as we all know) the problem with my design is that it doesn't keep some opening and closing tags together in the same file.

For example, Init () contains the <html>, but Footer () contains the </html>. <body> and </body> are similarly separated.

This isn't good at all, and is contrary to one of my strongest design goals - keeping related code together in one place - a philosophy which makes it easier to improve and maintain your code.

A recent discussion about this with a colleague of mine, Ken Reed, led to an experiment, and the code behind this article. This is a true OO concept that makes my design look as dated as pages that still use render blocks!

The Page Classes

Looking at the basic elements of an html page, I created the following classes: Page, Head, Body, Header and Footer.

Page is the top-level class, and contains one Head and one Body, each related to their html tags, <head> and <body>.

Body in turn contains a Header and a Footer, which although not related to any specific html tag pair are common page elements nonetheless.

These classes are defined in the SSI (Server Side Include) file called utils/PageClasses.asp.

Part 2: The Page Classes...

Featured sponsor
My favorite resources

Tiki Statues - Tiki Masks - Tiki Totems


CoverYourASP Mugs, T-shirts, caps - even Boxer shorts...
I don't make a penny from these, but they're a lot of fun! Don't you need a new mouse mat?


New Proposal Kit Professional 5.1
Brand yourself as a top professional: create quotes and amazing proposals and get many legal documents free!

The latter saved me 3 times the purchase price on the first day I owned it!