Click here to Skip to main content
15,868,164 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hey Guys,

I'm currently working on a test webpage,. I'm starting to get the idea of multiple page hooked in 1 masterpage for easier management. Now I got stucked on this, I want to have 1 master page to work on the Header navigation and footer, this is going to be applied to all page, so whenever a user browse any page it will look kinda similar. Now the second master page should work to fill the body of the page to anything the user needs to display, like a forum page or a review page.

So basically it should be:

1 masterpage for header footer navigation,<===always there wherever the user go

1 masterpage for body<===changes depends on what the user is looking(review, thread.

I did some reasearch but most people are talking about nested master page which based on what I understand is not really what I'm looking for.

The other option I think is directly insert a css manipulation on the body so there's only one masterpage needed for handling the header navigation and footer.

Thanks,
Posted
Comments
CoderPanda 5-Feb-14 9:58am    
Hi,
I would think nested master pages are suitable for this type of problems. Any reason why you think it isn't for you?
KatsuneShinsengumi 5-Feb-14 10:19am    
Hi,

I reread some stuff about nested master pages, and I think you right it seems like it's going to work. Just one question, this is how I think this is going to work:

Ex. I have 3 master page, 1 to layout the header,nav and footer, 1 is for forum layout, 1 is for review layout

Then does that mean it will work like this?
masterPageForHeaderNavFooter ---(nesting)------->masterPageForForum
masterPageForHeaderNavFooter ---(nesting)------->masterPageForReview

Thanks,

CoderPanda 5-Feb-14 10:22am    
Yes, you are right. By the way, I have used individual master pages for header, footer, body, side navs etc inside one main master page. That project was that content heavy in each of these sections. And it had worked well.
KatsuneShinsengumi 5-Feb-14 10:29am    
Really? that's awesome, do you mind telling a little more about how you daisy-chain more than 2 master pages?

You can create one Web UserControl for body part. Include that in the Page.
 
Share this answer
 
Comments
KatsuneShinsengumi 5-Feb-14 10:30am    
Thanks man, I'll look on that side aswell, but for now I think I'll go for the nested masterpage.
Hey guys, I used nested master page it's awesome, but also to those who'll have the same problem.
Remember this:

-your first masterpage is the one who will be nesting the second.(the nested one wont have the same html like structure as the first one because it's nested)
- the css file that you'll use on the first masterpage is also the one you'll use on the second one(you dont need to define it on the second one, it doesnt even have the common html tag structure to put it in the first place). It work on the second masterpage automatically because it is nested from the first one.

I can't mark CornerPanda's answer as my Solution, he should be the one to take the credit for this.

Thanks.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900