Thursday, February 2, 2012

Customize Application pages top navigation bar


As known that in SharePoint 2010 the application pages have a new property
called DynamicMasterPageFile that enable them to use the site master page
instead of using the OOB application.master. But it would maintain the default
top navigation control although the one in site master page changes.
The reason it maintains the default top navigation is that application pages override
content inPlaceHolderTopNavBar with a user control called TopNavBar.ascx where
it contains the default top navigation control (AspMenu).
To have the application master use our top nav control, we need to find the
PlaceHolderTopNavBar and PlaceHolderHorizontalNav in the master page, set it Visible = false
and make sure they don’t enclose any controls.
<asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server" Visible="false" />
<asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server" Visible="false"/>

No comments:

Post a Comment