Code Renaissance is about building great teams and great software. By exploring best practices, team interactions, design, testing and related skills Code Renaissance strives to help you create the team and codebase that you've always wanted.

Asp.net Work Around - Display Nested Master Pages in Design View

Here's a quick workaround for displaying nested master pages in Asp.net design view. As you may know, when you switch to design view on a page that inherits from a nested master page you will normally get the following notification:

"Design view does not support creating or editing nested master pages. To create or edit nested master pages, use Source view."

Interestingly if you place a space after the reference to the master file name (e.g. MasterPageFile="~/TemplateC.Master ") the IDE will let you switch to design view, only now you will get the following error in your error list.

"Could not find master '~/TemplateC.Master ' "

Once you rebuild your project that error disappears as well and everything works fine at run-time. In the design view you'll see all of the content that you have added (but not the content inherited from the master page). This will allow you access smart tags and wizards for configuring controls and do a little visual editing.

The lack of a full view of your page with inherited content is limiting. However, because the design view often greatly differs from the different browser renderings(including IE) I have long since gotten into the habit of keeping a browser open on my other screen to use as my "Design View" during development.

Hope this helps... I know it was really bugging me.

0 - What do you think?: