Build Logo Programming Web Sites
Integrating Includes and Subs on Single Page Sites

The Build Team - Specializing in "Proof of Concept" applications

Home | Single I | Single II | Single III | RAD I | RAD II | Program Site
Alliance Logo
Home
    Single Page Web Sites
    RAD Applications

    Message Board
    Index.asp code

  Down load this
  example web site


Introduction
The web evolved from static web pages. As a result the mindset of web developers since then tended toward the belief that a web site must consist of many separate pages. But the game has changed a lot from the early days. Now we can do incredible things with the web. One of these things is the ability to program a web site.

It is a commonly accepted practice to begin every web site with index.htm or default.htm. Why? Because that the way it was always done. Heck, I used to do it too. But then the client would the decide that a counter or something else was needed. Arrgh! Anyway to make a long story short, I eventually decided to begin my sites with index.asp or default.asp. That way no matter what the client wanted to add or change, I had the flexibility to incorporate the change without major changes to the site. And since the starting page was an ASP page, I also soon discovered that I now had the ability to program a web site.

This example site illustrates the power of programming a web site as opposed to the traditional building of a site. As you go through this site note that the page doesn't change, only the query strings. Three techniques are illustrated here to demonstrate the power, flexibility, and scalability of programming a site. Incorporated herein are two previous articles "Single Page Web Sites" and "Rapid Application Development", along with a simple show/hide method to pack a lot on a single page.

What I have here just scratches the surface. I gave three different looks to show that you can have multiple web "sites" on a single page. I also used a query string to change the background color of a table cell on index.asp to illustrate that you can format the structure and properties of the layout table itself. When you break out of the traditional mold and start programming web sites, a whole new world of possibilities opens up. Have fun and let your only limit be your own imagination!

Down load the zip and install this example site on your development machine. Then you'll have a ready reference when needed. You know, the times when you think "Now how did he do that?". Less ...

Scaling single page sites
"OK", you're probably thinking, "what do you do when the site is huge and very complex?". You simply do what programmers typically do when an application gets complex. You break it down into logical, well named blocks and move them to another file.

Using query strings to "compress/decompress" a page
This page illustrates this technique. When you click on the "More ... " link, the query string value for "decomp" is "intro" is used to call the "showIntro" Sub, which contains the rest of the text for the Introduction. This link, "Show Code", has for it's "decomp" value, "code" and also targets a bookmark demonstrating that you can also open a page where you want Show code

Using query strings to simulate a "normal" web site
The "Single Page Web Sites" link from the menu on the left takes you to the tutorial that illustrates how this is done. When using this method, index.asp will appear to be an entire site. Only by noting the URL in the address box of the browser will the real nature of the site be revealed.

Using query strings and form values to run a application on a single page site
The "RAD Applications" link from the menu on the left takes you to the tutorial that illustrates how this is done. It demonstrates how to call subs and functions on single page sites while at the same time shows the methodology that I typically use to develop my applications.

Recommended Reference:
To find out more about the pros and cons of using includes and server.execute see Michiel van Otegem's fine article: To include or not to include?

Other articles:

Michael Brinkley - Janurary 2, 2002
Send comments to: Mbrink1111@yahoo.com