Posts
295
Comments
27
Trackbacks
206
Setting the master page in web.config

We already know that the Visual Studio 2005 designer doesn't support nested master pages, but it's worth pointing out other problems when setting the masterPageFile attribute of the element in web.config. There are two issues with content pages in this scenario:

1. The designer does not render the Content area. Instead you get a gray box with "Content controls can only be used in a content page."
2. Schema information isn't available, and therefore IntelliSense is inaccurate.

The scenario is easy to reach:

1. Create a master page. No need to change anything.
2. Create a content page and remove the masterPageFile attribute from the Page directive.
3. Add a masterPageFile attribute to the element in web.config.
4. In the content page notice the IntelliSense errors, and switch to the designer.

For me this isn't a big problem for two reasons. First I tend to use CSS layout, which means that centrally setting the master page isn't overly important, as global changes can b achieved by changing the CSS (either manually or via themes). Second, I don't tend to use the design surface much, partly due to my use of CSS - the designer has, err, issues when using CSS layout.

posted on Wednesday, October 12, 2005 12:57 PM Print
Comments
 re: Setting the master page in web.config
jan slatter
12/14/2005 5:51 PM
vs 2005 does support nested master pages

see:- http://winfx.msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_aspnetcon/html/ec29afad-b7f5-4c58-a4db-b538dbfcea1b.asp
# MasterPageFile in Web.config
Ian Blackburn's Weblog
2/2/2006 1:14 PM
# MasterPageFile in Web.config
Ian Blackburn's Weblog
2/2/2006 1:15 PM
Comments have been closed on this topic.