Click here to Skip to main content
Click here to Skip to main content
Go to top

Fake Frames

, 20 Jul 2000
Rate this:
Please Sign up or sign in to vote.
An article about faking frames to have pages with the same layout by using server side includes

Introduction

So you want to have a page that has a menu in the left, your banner in the top and the copyright and contact info below. I call this the classic layout.

Usually you use frames to accomplish this wish. But if you don't want to use frames, you would have to copy the almost static parts of each section of the page to each page in your site. That's ok.

But if you have to update the menu or the contact email, you would have to change a lot of pages, which is a kind of boring :-/, and it would cost you a good amount of time.

The solution I have is to use server side includes for those parts that are static (menu, copyright info, banner, ...). With the use of tables you'll have a framework for your pages.

So to update one of this static items you change the include file and all the pages will be ok.

The example will have this look:

These are the include files:

  • left.asp : for the left menu
  • top.asp : for the banner image
  • bottom.asp: for the contact and copyright stuff

Using server side includes in ASP is easy: just create a page you wish to include (your menu, top banner, bottom copyright etc) and then in your main page add the declaration:

<!--<span class="code-comment"> #include virtual="include_file.asp" --></span>

where include_file.asp is the file you wish to include. "#include virtual=" means the page's path is specified relative to the web root. You can also use "#include file=" which means the path is specified as relative to the current page's directory.

More information about include files can be found typing "#include" on the index page of MSDN.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

xicoloko
Architect VisionOne AG
Switzerland Switzerland
XicoLoko is a brazilian developer based in Switzerland.

Comments and Discussions

 
GeneralFrames and IIS PinsussGabyO5-Nov-04 12:04 
GeneralUsing a variation on this can be a real improvement! PinmemberMike Whitenton2-Jul-01 16:19 
GeneralRe: Using a variation on this can be a real improvement! PinmemberCaio Proiete12-Jun-03 10:47 
GeneralRe: Using a variation on this can be a real improvement! PinmemberMike Whitenton12-Jun-03 12:02 
GeneralRe: Using a variation on this can be a real improvement! PinmemberCaio Proiete12-Jun-03 15:46 
GeneralRe: Using a variation on this can be a real improvement! PinmemberMike Whitenton12-Jun-03 12:22 
Just one more thing. The solution shown in the article suffers from the same problem as my example when site usage increases. Each .asp page must be parsed in the main .asp page as a whole.
The best solution varies depending on the situation.
My understanding as this moment in time is for busy websites is to use a compiled language to generate the html code. .aspx or .dll are decent choices.

GeneralRe: Using a variation on this can be a real improvement! PinmemberCaio Proiete12-Jun-03 15:49 
Generalinclude file alt PinmemberAnonymous30-Jan-01 2:33 
QuestionASP or IIS thing? PinsussTerry Mulvany2-Nov-00 17:59 
AnswerRe: ASP or IIS thing? PinsussUwe Keim2-Nov-00 19:15 
GeneralI've always called this "Server-Side Framing" PinsussUwe Keim21-Jul-00 20:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 21 Jul 2000
Article Copyright 2000 by xicoloko
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid