C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » ASP.NET/Web Applications »

Nested Master pages in VS2008


Posted Date: 07 Feb 2008    Resource Type: Articles    Category: ASP.NET/Web Applications
Author: ChandraShekar ThotaMember Level: Diamond    
Rating: 1 out of 5Points: 10



I think every one knows Master pages role in asp.net for building applications.Previously theres is an option to creare a master page and then create content
page related to that master page.In vs2005 let me tell yOu procedure for master pages creation and contentent pages from it. Go to solution explorer right

click and add new item.Select master page and then clik ok. done your master page will be generated. fill your content related to design and put some content

place holders. Now take a webform and make mater page file relate to it.Remember content place holder is to insert any changing content.

Now let me tell you one thing. VS2008 has "nested master pages" support. It means we can work with many master pages which are iner related and access them

through a webform. Let me expalin you in steps how to create and use them so that it will be very easy for a beginner.

Step 1: Go to solution explorer
Step 2: right click
Step 3: add new item
Step 4: select master page
Step 5: fill your content / design/ content pace holders
Step 6: remember this master page you can use a s root master page as we are taking many master pages now
Step 7: Now lets create another master page making root master page as root
Step 8: go to solution explorer
Step 9: right click
Step 10: add new item
Step 11: select master page
Step 12: while selcting mater page you find to check boxes below
Step 13: one is place code in seperate file
Step 14: second is select masterpage
Step 15: select second one and first one is to your wish
Step 16: it then asks for a master page to pick up
Step 17: you can pick up the master page you did before.
Step 18: done your second master page is now ready which depends on root master page
Step 19: similarly create any number of master pages now
Step 20: now lets use those master pages
Step 21: Go to solution explorer
Step 22: right click
Step 23: add new item
Step 24: select webform
Step 25: see that while selecting webform you find 2 same check boxes again
Step 26: select "select master page"
Step 27: now its your turn to select which master page you need for your webform
Step 28: it asks for selection of master page(s) which you developed before.

Remember you can work with any number of master pages and any number of webforms.All are based on root master page.
If we change any thing in root master page that reflects to all other .
While i used to be answering in dotnetspider and asp.net forums i used to see many and many people facing problems with master pages in vs2005.So i think

Summary : "Nested Master Pages" concept will be really useful for ths people who work with master pages.

Negative feedback is higly appreciated.

Cheers
Chandu





Responses

Author: sandhya bhavani    08 Feb 2008Member Level: Gold   Points : 0
Hello,

Nice Article......

what i understood We are adding masterpages same as in vs.2005.but how we can select which is the root and which is the child .Any option is there to select root master?.or wat ever we added first masterpage tat comes to root master only.


can u explain briefly...........

i am expecting more like how to call masterpages in codebehind...

Thanx For nice Posting
Sandhya


Author: ChandraShekar Thota    08 Feb 2008Member Level: Diamond   Points : 0
Assuming you take a first master page. While you are going for second master page it ask to select a root master page and obviously u will be having only first one and you have to select it making it root. As dotnet spider doesnt support images i am sorry for such explaination in steps.


Author: Happy Coder    23 Apr 2008Member Level: Gold   Points : 0
Gud one


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Web Services
Previous Resource: Highlight Datagrid or GridView row on mouse over
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET/Web Applications


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use