"unexpected error has occurred" error in Sharepoint Custom Master page

Symptoms:

 If you are unable to see the properties of document library items in the SharePoint site and getting "unexpected error has occurred" and after enabling the callstack ="true" and customerrors = "OFF", getting below error

 

 

Error Message

 Server Error in '/' Application.

------------------------------------------?

Cannot find ContentPlaceHolder 'PlaceHolderLeftNavBar' in the master page '~masterurl/default.master', verify content control's ContentPlaceHolderID attribute in the content page.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

?

Exception Details: System.Web.HttpException: Cannot find ContentPlaceHolder 'PlaceHolderLeftNavBar' in the master page '~masterurl/default.master', verify content control's ContentPlaceHolderID attribute in the content page.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.?

?

Stack Trace:

[HttpException (0x80004005): Cannot find ContentPlaceHolder 'PlaceHolderLeftNavBar' in the master page '~masterurl/default.master', verify content control's ContentPlaceHolderID attribute in the content page.]

?? System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +1190

?? System.Web.UI.Page.get_Master() +65

?? System.Web.UI.Page.ApplyMasterPage() +18

? ?System.Web.UI.Page.PerformPreInit() +61

?? System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1272

 

Specific error message

-----------------------------

Cannot find ContentPlaceHolder 'PlaceHolderLeftNavBar' in the master page '~masterurl/default.master', verify content control's ContentPlaceHolderID attribute in the content page.

Note:

Modify the "default.Master" page in SharePoint is not recommended. Always create a copy of master page and then modify the copied master page as per the requirement.

Some good TechNet article which talk about this.

Building Simple Master Pages for Windows SharePoint Services 3.0

 

  <https://msdn.microsoft.com/en-us/library/bb684920.aspx>

How to customize application pages in the Layouts folder in SharePoint Server 2007 and in Windows SharePoint Services 3.0

https://support.microsoft.com/kb/944105

 

Reason for this error.

 

ContentPlaceHolder 'PlaceHolderLeftNavBar' missing in the in the custom Master page.

 I got this error on the custom master page not in the "Default OOB " SharePoint Master page.

I have done following steps to resolve the error in the Custom Master page

 

o  Open a SharePoint Designer.

 

o  Open the site by clicking File | Open Site options.

 

o  Expand the _catalogs folder.

 

o  Expand the MasterPage Gallery Folder.

 

o  Right click on the custom masterpage you want to work with and select Check Out.

 

o  Now open the custom Master page again.

 

o  In the Find and Replace dialog, enter this : "<asp:contentplaceholder" (without quotes) and Clicked on Find All.

o  Add below code in the custom master page.

  <asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server"/>

o  Saved the Custom Master page and "check in" the Custom Master page.

 

o  After this we should be able to view the properties of the documents in the document library.

 

 

------------------------------------------------------------------------------------------------------------------------------------------

Disclaimer:

All posts are provided "AS IS" with no warranties, and confers no rights.