Include Header and Footers - No Frames How?

  • Thread starter Thread starter James Hancock
  • Start date Start date
J

James Hancock

I'm trying to create a comprehensive web site for which I don't want to use
frames. However every page is going to have the same header and footer, so I
want to write it once and be done with it without using frames. (apparently
they are bad or something)

All is fine using the #Include File directive as long as the pages that I'm
including are static html. However, what I want to do is have these Headers
and footers have dynamic content in them (i.e. Date/Time etc.) with code
behind etc. If I do so, I get an error that only one page directive is
allowed per page. If I use the Response.WriteFile() command it doesn't
execute the code behind stuff or any of the scripts that I directly put in
the header information.

I used to be able to do this in ASP so I'm getting frustrated. If anyone can
point me in the right direction I would forever greatful :)

Thanks,
James Hancock
 
You might try the following:

- organise your page with DIV's into header, main, footer
- put a Literal control in the header and footer
- write your header stuff etc controls into the Literal as HTML
- if you need to use those controls, then you need to register them in
your code as well to get them to work
- you could create a base class between the Page class and your
separate pages to contain common actions

Charles
 
wow. No simple way of having header and footer pages?

Thanks, I think it will be easier to convince them to use frames....

James Hancock
 
Back
Top