In this article I have explained how you can create a basic
Master Page. But in fact you can do lot of stuff with this Master Page. On one
of my recent projects I had to create a Master Page which had tabs, 3 or 4
navigation menus and they wanted the Search control without the default
dropdown for Scope. So, I would like to present some tips on customizing the
Adding menu system to launch external websites: This could
have been easy with the local navigation. But they wanted it separate from
local navigation as it was already used up. I came up with using the ASP:Menu
control provided by ASP.NET 2. If you look closely the Navigation menu SharePoint:ASPMenu
control is actually inherited from System.Web.UI.WebControls.Menu. I used the ASP:Menu
control on my SharePoint Master Page. Below are the steps involved in adding
your own Navigation menu.
Step1: At the appropriate place add the asp:menu control.
The syntax could be as:
<asp:Menu runat="server" id="Menu1" width="100%" DataSourceID="ExternalLinks"
Step 2: Now we need to assign the asp:SiteMapDataSource for
the above DataSourceID=Externallinks. The sitemapdatasource can be declared as:
<asp:SiteMapDataSource runat="server" ID="ExternalLinks" ShowStartingNode="False"
Step 3: Now we have defined MyMenuProvider as the
SiteMapProvider. But we need to let it know where to get the sitemap file. So,
we need to add this in the Web.Config file under the SiteMap->Providers
section in Web.Config file.
type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" siteMapFile="Menu.sitemap"/>
Page to do lot of formatting stuff. The main formatting was the look and feel
Search Control completely. By default, the search control was displaying the
Search Scope dropdown list box, text to enter search and the magnifying glass
image. The client wanted to replace the magnifying image and remove all the
items from the dropdownlist box except for the Directory. The following is the
Below is the Listing to remove the scopes from the dropdown
and just list the Directory option.
ddlSelects = document.getElementsByTagName('select');
for (var i = 0; i < ddlSelects.length; i++)
if (ddlSelects(i).title == "Search Scope")
for (count = 0; count < ddlSelects(i).options.length; count++)
if (ddlSelects(i).options(count).text == "Directory")
diroption = ddlSelects(i).options(count);
ddlSelects(i).options.length = 0;
This is the listing to change the magnifying icon glass at
run time only for this Master Page.
ahrefs = document.getElementsByTagName('a');
for (var i = 0; i < ahrefs.length; i++)
if (ahrefs(i).title == "Go Search")
"<img title=\"Go Search\"
onmouseout=\"this.src='/_layouts/images/button_go_01.jpg'\" alt=\"Go Search\"
src=\"/_layouts/images/button_go_01.jpg\" style=\"border-width:0px;\" />";
In short, there are various things you can do to the Master
Page. In fact, the stuff you could do on ASP.NET applications master page can
also be done on the SharePoint Master Page.