Templates/user controls or both??

D

Divya

Hello

I am trying to use a template in my asp.net application so that, I can use the same code for different sites (each site must have a different template - style and content). What would be the best approach? I came across a few articles that talked about using template controls. I am not sure if this is what I need to use. Could someone please help

The approach I was thinking about
1. Use a template.htm file in each of the site's directory (contains the content - for eg: Header and Footer text)
2. Apply different CSS (path of which can be obtained from the config file) for different sites
3. Render all this in the test page's PreRender()......or should I use Render()?
If I use the above steps how do I load the template.htm in my aspx page

Any help with this will be greatly appreciated

Thanks
-Divya
 
S

Scott Mitchell [MVP]

Divya said:
I am trying to use a template in my asp.net application so that, I can use the same code for different sites (each site must have a different template - style and content). What would be the best approach? I came across a few articles that talked about using template controls. I am not sure if this is what I need to use. Could someone please help?

Divya, look into the MasterPages technique. This is going to be the
templating approach used in ASP.NET 2.0. There are MasterPage
implementations in ASP.NET 1.x, you can learn more at:

Creating Template-Driven Web Sites with MasterPages
http://aspnet.4guysfromrolla.com/articles/040704-1.aspx

Happy Programming!

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
 

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,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top