[thelist] fusebox in ASP

David.Cantrell at Gunter.AF.mil David.Cantrell at Gunter.AF.mil
Mon Feb 3 13:08:09 CST 2003


>Now, I can't stop the implications from rolling around in my head and
bumping into each other.
>Please excuse, I am just starting to get into OOP, so this is all very
revolutionary to me.

Light bulbs... ;)

>I currently envision a main template (index.asp) that will pass values to a
work file
>which will process those parameters and server.execute the correct content
to include on index.asp.
>Bearing in mind that all content is already marked up in xhtml and ASP and
I am essentially
>just doing conditional includes, is it as easy as what I am proposing, or
am I missing something?

Yes! :)

This is exactly what I do. As I said, the code I've written simply
formalizes this approach. For example, each module has a file called
layout.xml, which contains the list of all available actions for this module
and their associated files. An action may be marked up as follows (taken
from my /home module):

    <action name="home"
            pageTitle="Home Page"
            displayPageTitle="false">
            <main src="act__home.asp"/>
    </action>

<main> contains the file to Server.Execute to show the main content for the
page. Headers, footers, navigation (3 levels: global, site, and left nav;
see microsoft.com for example), and stylesheets can all be specified in a
site-wide configuration xml file, then overridden at the module level (via
layout.xml), and then overridden again at the <action> level. And if you
want to get really fancy, each action can have more than one <main> file,
and they are Server.Executed in the order they appear in the XML file. I
have no real need for this, but hey, it's a side-effect of the way I wrote
the code, so I left it there in case someone else wants to use it. ;)

So the above action markup might equate to this URL:

	http://www.mysite.com/home/?action=home

I have adopted a naming convention for action files of "act__" (two
underscores), plus the action name. This helps keep everything nice, neat
and orderly when I'm browsing files. Of course, if I want to change the file
it points to, I just change the XML file, no need to mess with external
links pointing to the resource at all.

I do have to say, this ultra-modular approach makes updating the site and
creating new pages a snap. I'm teaching a couple of folks who have "some"
web development experience (and taking over my job soon as I move on) and at
least one of them had the light bulb go off and thinks it's a great idea.
The other one, well, he's a designer, so there's no hope left for him. ;)

HTH,
-dave



More information about the thelist mailing list