TechBubbles Microsoft Technology BLOG

ASP.NET 3.5 Nested Master Pages

Introduction

This post explains the improved designer for creating Nested Master pages in visual studio 2008 and ASP.NET 3.5. Nested Master pages are used when you are build a hierarchy of templates for your web site.

For Example your Enterprise may have the corporate style header and each of your department in your organization may have different templates styles there you can use nested master pages for designing the templates.

You did have this feature in ASP.NET 2.0 but you were not able to work out with the visuals in the designer.

Working with Nested Master pages in VS 2008 and ASP.NET 3.5 in a sample

 

1. Create a New Web site in VS 2008 File, New Web site it looks like the following screen shot

Master

   

2. Create a Nested Master page to link the above master page by right clicking the web site and select add new item option  dialogue box will appear from there select the NestedMasterPage template.

NestedMaster

NestedMasterPages allows you to link masterpages together.

AddMaster

 

Select the Master page and click ok it will link to the selected masterpage.

NestedMasterEdit

We have created the above NestedMasterPage for a Department. The new feature that you need to observe is you are able to see the visuals in designer where you can edit the content in NestedMasterPage and you can view the results immediately in designer.

 

3. Now we are going to create a content page for this NestedMasterPage. Right click the project and select Add New Item the following dialogue box will appear

Content

Instead of selecting a Web Form, we have new option Web Content form template in VS 2008 select this template for creating the content page for the NestedMasterPage.

 

4. The NestedContentPage will looks like the following

 

Content3

 

This is basically representing the what we are going to see in browser by having the Global MasterPage, NestedMastePage and Content Page which really increasing the developer integrated design experience.

About the author

Kalyan Bandarupalli

My name is kalyan, I am a software architect and builds the applications using Microsoft .NET technologies. Here I am trying to share what I feel and what I think with whoever comes along wandering to Internet home of mine.I hope that this page and its contents will speak for me and that is the reason I am not going to say anything specially about my self here.

2 Comments

TechBubbles Microsoft Technology BLOG

Follow me

Archives

Tag Cloud