question about page template - please help

  • Thread starter Thread starter suzy
  • Start date Start date
S

suzy

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.
 
Back
Top