How do you handle template creation in ASP.NET?

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.
 
M

Marina

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top