469,890 Members | 1,448 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,890 developers. It's quick & easy.

question about page template - please help

hi,

i have created a aspx page template by creating a template.cs file which
inherits from the page class. In this file I override the OnInit event and
create a template in the form of a header, left menu and a footer. there is
also a body area where the main content of the page will go.

i created these 4 areas by dynamically creating a placeholder in each area
at runtime. in the template.cs i load user controls into each area except
for the body area (as this is meant to be populated by the main aspx page).

in my aspx page (which inherits the template class) if i create controls at
runtime i can simply reference the placeholder in the main body area, and
add a control to it at runtime.

my problem is that if i try and create controls at design time in my aspx
page, they appear before the header, rather than in the main body area.

i had a feeling i was creating my template in a wrong way when i did it,
because i was generating html code in my .cs file and it's hard to
read/maintain when you have several table cells.

can anyone please give me an example of how to create a template with a
header, left menu and a footer?

i have examples on the net but they all seem to be doing it in different
ways.

ps: i am a beginner to asp.net.
Nov 17 '05 #1
1 1290
Check out this article, this will help you. Here i have explained the basic
stuff of Page Template, how you need to create page templates. I have also
given links to various article which talks about Page Template
http://www.microsoft.com/india/msdn/articles/87.aspx

--
Saravana
Microsoft India Community Star,MC**
www.ExtremeExperts.com

"suzy" <me@nospam.com> wrote in message
news:Oq**************@tk2msftngp13.phx.gbl...
hi,

i have created a aspx page template by creating a template.cs file which
inherits from the page class. In this file I override the OnInit event and create a template in the form of a header, left menu and a footer. there is also a body area where the main content of the page will go.

i created these 4 areas by dynamically creating a placeholder in each area
at runtime. in the template.cs i load user controls into each area except
for the body area (as this is meant to be populated by the main aspx page).
in my aspx page (which inherits the template class) if i create controls at runtime i can simply reference the placeholder in the main body area, and
add a control to it at runtime.

my problem is that if i try and create controls at design time in my aspx
page, they appear before the header, rather than in the main body area.

i had a feeling i was creating my template in a wrong way when i did it,
because i was generating html code in my .cs file and it's hard to
read/maintain when you have several table cells.

can anyone please give me an example of how to create a template with a
header, left menu and a footer?

i have examples on the net but they all seem to be doing it in different
ways.

ps: i am a beginner to asp.net.

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Rainer Herbst | last post: by
1 post views Thread by MArc Baumgartner | last post: by
11 posts views Thread by Random | last post: by
4 posts views Thread by cgaden | last post: by
4 posts views Thread by Goran Djuranovic | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.