Ask a Question related to ASP.NET General, Design and Development.
-
suzy #1
newbie: asp page templatess
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.
suzy Guest
-
Newbie trying to add a jpg to exsisting page
Have been playing around trying to figure out how to add a new .jpg to a page on an exsisting website. There are exsisting .jpgs on that page. When... -
2 SQL queries in 1 asp page -- Newbie
I am trying to run 2 queries against a Access2k database on a single ASP page. I have one query working beautifully, but am not sure how to... -
Newbie Question - Two on One Page
How do I use acrobat and change my pdf so that I have two of the same document on one page. Do I need a plugin and if so which one? All help is... -
Newbie Q: Return Error to Page?
Hi, I have a web service method which will connect to a Access database, which look like below: public DataSet Search(string strSearch) {... -
newbie array inside a asp page
Hello! Was thinking of having an array inside a asp page. I'm rather new to this. How do I begin. my asp page should work as follows: 1. One... -
Marcin #2
Re: newbie: asp page templatess
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.Marcin Guest
-
suzy #3
Re: newbie: asp page templatess
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.c om...news:<uS3ZEPbVDHA.2328@TK2MSFTNGP12.phx.gbl>...> 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 messagei> > hi i am quite new to .net and am trying to implement page templates buton> > just cant seem to get it to work, and i dont quite follow the examplescontrol),> > the net.
> >
> > all i want to do is create a template where i have a header (usertemplate.cs> > 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 ainherits> > file which inherits from the page object. and then my aspx pagethat.> > from the template.cs object, but the examples seem to confuse me after
suzy Guest
-
Marcin #4
Re: newbie: asp page templatess
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
"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.c om...> news:<uS3ZEPbVDHA.2328@TK2MSFTNGP12.phx.gbl>...> > 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> i> > > hi i am quite new to .net and am trying to implement page templates but> on> > > just cant seem to get it to work, and i dont quite follow the examples> control),> > > the net.
> > >
> > > all i want to do is create a template where i have a header (user> template.cs> > > 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> inherits> > > file which inherits from the page object. and then my aspx page> that.> > > from the template.cs object, but the examples seem to confuse me afterMarcin Guest



Reply With Quote

