It should work.
It will reneder the controls in the following sequence:
1. header.
2. your page content (that inherits from PageTemplate)
3. footer
All the tags should be placed in such a way that when the page is
rendered it will generate valid HTML code. For example:
<html> <head></head> and opening <body> tag could go to the header
control.
</body> and </html> could go to your footer. Your page content should
define only the "inner part" of the page (no <body>,<head> tags
etc..).
Good luck.
Marcin
[quoted text, click to view] "suzy" <me@nospam.com> wrote in message news:<#VdwR3eVDHA.1948@TK2MSFTNGP11.phx.gbl>...
> it doesn't work for me.
>
> the header and footer appear, but not the main content.
>
> how should i be adding my main content to my main page? and where do the
> html/body/title/etc tags go?
>
> thanks
>
> "Marcin" <m_now@o2.pl> wrote in message
> news:d71a96eb.0307290620.4da3279a@posting.google.com...
> > Hi,
> >
> > Yes you can inherit from Page class. In your template override
> > OnInit() method and load your header and footer controls.
> >
> > example:
> > protected override void OnInit(EvantArgs args)
> > {
> > this.Controls.AddAt(0, LoadControl("path to header.ascx " );
> > base.OnInit(e);
> > this.Controls.Add(LoadControl("path to footer.ascx"));
> > }
> >
> > Now if any page will inherit from template class it will be wrapped in
> > header and footer.
> >
> > Regards
> > Marcin
> >
> >
> >
> > "suzy" <me@nospam.com> wrote in message
> news:<uS3ZEPbVDHA.2328@TK2MSFTNGP12.phx.gbl>...
> > > hi i am quite new to .net and am trying to implement page templates but
> i
> > > just cant seem to get it to work, and i dont quite follow the examples
> on
> > > the net.
> > >
> > > all i want to do is create a template where i have a header (user
> control),
> > > left column, and footer on every page. the remainder of the page will
> > > change per page.
> > >
> > > can anyone please help? i think i know that i have to create a
> template.cs
> > > file which inherits from the page object. and then my aspx page
> inherits
> > > from the template.cs object, but the examples seem to confuse me after
it doesn't work for me.
the header and footer appear, but not the main content.
how should i be adding my main content to my main page? and where do the
html/body/title/etc tags go?
thanks
[quoted text, click to view] "Marcin" <m_now@o2.pl> wrote in message
news:d71a96eb.0307290620.4da3279a@posting.google.com...
> Hi,
>
> Yes you can inherit from Page class. In your template override
> OnInit() method and load your header and footer controls.
>
> example:
> protected override void OnInit(EvantArgs args)
> {
> this.Controls.AddAt(0, LoadControl("path to header.ascx " );
> base.OnInit(e);
> this.Controls.Add(LoadControl("path to footer.ascx"));
> }
>
> Now if any page will inherit from template class it will be wrapped in
> header and footer.
>
> Regards
> Marcin
>
>
>
> "suzy" <me@nospam.com> wrote in message
news:<uS3ZEPbVDHA.2328@TK2MSFTNGP12.phx.gbl>...
> > hi i am quite new to .net and am trying to implement page templates but
i
> > just cant seem to get it to work, and i dont quite follow the examples
on
> > the net.
> >
> > all i want to do is create a template where i have a header (user
control),
> > left column, and footer on every page. the remainder of the page will
> > change per page.
> >
> > can anyone please help? i think i know that i have to create a
template.cs
> > file which inherits from the page object. and then my aspx page
inherits
> > from the template.cs object, but the examples seem to confuse me after
that.