Take the 2-minute tour ×

I am implementing a global navigation solution.

The issue is this; long story short (I can elaborate on it if you wish): All pages in the _layouts directory override all the content in the "PlaceHolderTopNavBar" ContentPlaceHolder control in the MasterPage with a TopNavBar.ascx UserControl.

If you've created a custom MasterPage, and have also created your own custom navigation (perhaps with your own SiteMapProvider), these navigation customizations are not shown in any of the _layouts pages (such as Site Settings), because of the aforementioned issue.

The only way around this that I could find, is to edit the TopNavBar.ascx file directly. And even though I can create a solution that deploys fine, I still don't like that I have to overwrite a SharePoint file.

I would much rather be able to create an item in my Elements.xml file that overrides the ASPMenu control in the TopNavBar.ascx file, but I can't because it's not wrapped in a delegate.

Am I stuck with the wonky overwrite of the TopNavBar.ascx?

UPDATE: A better alternative that I have come up with so far, is to move the PlaceHolderTopNavBar ContentPlaceHolder control into a hidden div in the MasterPage while keeping their contents (the ASPMenu and SiteMapDataSource controls) where they are. Thus, they don't get replaced by the settings.aspx page.

share|improve this question
What version of SharePoint do you use? masterpage mechanics is different in 2007 and 2010. –  Andrey Markeev May 13 '11 at 6:37
I'm working with 2010. –  blackf0rk May 13 '11 at 13:17

2 Answers 2

Yup, either hide the out of box PlaceHolderTopNav, or don't put your global navigation in the PlaceHolder so it won't get overridden. If you don't want pages to override your content in placeholders...don't put it in a PlaceHolder.

share|improve this answer

The best way to override default sharepoint controls is to use Control Overrides. This is a Feature Element that takes a ControlId (TopNavBar) and redirects it throughout the site to a custom control. The other way is to edit the compat.browsers file in the web app's IIS directory. This allows for control redirection (following the adapter design pattern) for an entire web app.

share|improve this answer

Your Answer


