How do you handle template creation in ASP.NET?

  • Thread starter Thread starter DKode
  • Start date Start date
D

DKode

I have been researching a couple of different ways to accomplish a
master "Template" page, usually being default.aspx or index.aspx that
holds the repeating content of the site.

Most of the postings i've come across say they have a main page, and
all the subpages they create as a UserControl. i.e.: index.ascx,
contact.ascx and then by using a unique query string, they call the
usercontrols into the main page. i.e.:
http://www.mysite.com/index.aspx?page=contact

I am wondering what other options might be available that we can use
as it seems kind of strange to have to use UserControls for page
content. is there any other suggestions that people have employed that
work well?

I would greatly appreciate any comments anyone might have on this.
 
You could also have a base page class. This base page outputs the content
common to all pages (site navigation, etc. Your other pages all inherit
from this class instead of from Page, and have additional content specific
to each page.
 
Back
Top