views:

34

answers:

1

Is it possible to build some kind of Master page with classic ASP WITHOUT frames or iframes?

I'm thinking if there is a way to include content pages to the main page like in ASP.NET master pages. From what I have researched ASP classic does support include of other ASP/HTML pages on a page, but the value put into this include means the function can not be dynamic.

+5  A: 

You could just create functions (say, a Header() function and a Footer() function) which do nothing but output some set of markup. Those functions can take parameters too, and be called conditionally. It's not quite the same as a Master page, but it sounds like it accomplishes what you are trying to do. You would have an <!--#include file="headerfooter.asp"--> on each page, and each page would call Header() & Footer().

Or you can just use <!--#include file="header.asp"--> at the top and <!--#include file="footer.asp"--> at the bottom of each page too. I've seen both approaches.

If you are looking for the reverse, that is, a single template page which calls individual pages in it's "middle" section, then that's not really something you can do easily with ASP classic. It's a fundamental difference in approach: ASP.NET has a concept of a control tree, events, etc, while ASP Classic is essentially just a script that runs top to bottom.

mgroves