469,924 Members | 1,417 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,924 developers. It's quick & easy.

How to make all pages have the same layout

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.
--
Thanks Brian
Nov 18 '05 #1
6 1925
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!
"briand" wrote:
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.
--
Thanks Brian

Nov 18 '05 #2
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.


Nov 18 '05 #3
ASP.NET 2.0 Master Pages are the great solution.
Unfortunately it's still in beta for now, so if you need something now for
production I'd suggest user controls.

Here are a couple of alternatives:
http://authors.aspalliance.com/PaulW...rticles/?id=14
http://www.sellsbrothers.com/writing...mtemplates.htm

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"briand" <br****@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
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.
--
Thanks Brian

Nov 18 '05 #4
Thanks, I look forward to the release of MasterPages

Nov 18 '05 #5
You can try out Page template option. Check out this article for more
details,
http://www.microsoft.com/india/msdn/articles/93.aspx
--
Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com
"briand" <br****@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
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.
--
Thanks Brian

Nov 18 '05 #6
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.

"briand" <br****@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
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.
--
Thanks Brian

Nov 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by keith edward | last post: by
15 posts views Thread by DesignGuy | last post: by
3 posts views Thread by Rennie deGraaf | last post: by
7 posts views Thread by Dean Trower | last post: by
67 posts views Thread by Sandy.Pittendrigh | last post: by
2 posts views Thread by Craig Kenisston | last post: by
1 post views Thread by Sasha | last post: by
1 post views Thread by Jeff | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.