How to make all pages have the same layout

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I make many pages with the same layout?
I have created header, side bar, main body, and footer web controls and
added them to a table. I have many pages that want to use this same layout,
BUT I DON"T to have to duplicate the layout in each page.
Is it possible to use the layout from one base class or template?
Inheritence only inherits the methods and properties, but not the layout and
addition of the web controls.
 
All pages can have the same Layout and the Data/content can change!
I don;t know what your pages would look like!
U can make use of USERCONTROLS!
 
I am using USERCONTROLS but I have to add the user controls to every page.

Eg
Say Product1 page has a header , footer, sidebar and main section for info
about Product1. These are all added to a table.
Also Product2 has a header , footer, sidebar and main section for info about
Product2. These are all added to a table.

Now if I want to change that layout I have to change both pages.

I was hoping it would be possible to create one page template.aspx and then
derive all ofther pages from that that. So chaning the layout only involves
changing the one page template.aspx.

I guess I can one user control with a header , footer, sidebar and main
section for info about Products. These are all added to a table. Then add
this control to every page.

I new to ASP.NET development but have a Apllication development background
where deriving from one control includes all the UI components and not just
the properties and methods as in ASP.NET.
 
http://www.devx.com/dotnet/article/18011

This article shows you how to create very flexible and re-usable page
templates. This article is fantastic as it lists the possible methods to
achieve page templating in ASP.NET 1.1, explains the best way, then has lots
of code to demonstrate how to do it.
 

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

Similar Threads


Back
Top