Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I created a custom Master page in visual studio, deployed it and used the FeatureActivated event to set it to the default and custom master for the site.

SPWeb curWeb = (SPWeb)properties.Feature.Parent;
SPSite curSite = curWeb.Site;
SPWeb rootWeb = curSite.RootWeb;
Uri masterUri = new Uri(rootWeb.Url + "/_catalogs/masterpage/FamilyCare.master");
rootWeb.MasterUrl = masterUri.AbsolutePath;
rootWeb.CustomMasterUrl = masterUri.AbsolutePath;
rootWeb.Update();       

All the site pages that i deploy to the content database are fine and use the new master. However there are a few pages in the _layouts directory like ManageFeature.aspx that are now having a problem. When i try to load them they give a generic error" So i copied the code into a temp site page in Sharepoint Designer to see if i could dianose the issue and i get the following message

"The page has controls that require a Master Page reference, but none is specified.  
 Attach a Master Page, or correct the problem in Code View"

I don't understand what it is talking about...this aspx file has not been modified from when Sharepoint 2010 was installed. Sharepoint designer indicates that the default and custom master are set....and the problem persists even if i manually switch the master page. Any suggestions as to what i did wrong?

share

1 Answer 1

up vote 0 down vote accepted

Most likely your new custom masterpage doesn't contain all ContentPlaceHolders referenced by Content contols in ManageFeature.aspx.

You need to verify that each asp:Content ID in ManageFeatures.aspx has corresponding asp:ContentPlaceHolder ID in your custom masterpage. You probably started building your masterpage from scratch or from some minimal template so something is missing.

share

This site is currently not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .