Customizing Small Search Box

Small Search control which is rendered in default  pages of Sharepoint is a delegate control which is rendered through Default.Master available under C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL (assuming C drive is the installation drive for MOSS)


Entry in Default.Master Page

<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">

    <SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" />


This control is actually available through a feature called "OSearchBasicFeature" located under 12\TEMPLATE\FEATURES.  In the feature elements file (in this feature it's called "SearchArea.xml"), you can see the following:

<Elements xmlns="">





        ControlAssembly="Microsoft.SharePoint.Portal, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c">

    <Property Name="GoImageUrl">/_layouts/images/gosearch.gif</Property>

    <Property Name="GoImageUrlRTL">/_layouts/images/goRTL.gif</Property>

    <Property Name="GoImageActiveUrl">/_layouts/images/gosearch.gif</Property>

    <Property Name="GoImageActiveUrlRTL">/_layouts/images/goRTL.gif</Property>

    <Property Name="DropDownMode">ShowDD</Property>

        <Property Name="SearchResultPageURL">/_layouts/osssearchresults.aspx</Property>

    <Property Name="ScopeDisplayGroupName"></Property>

    <Property Name="FrameType">None</Property>




The main class here seems to be Microsoft.SharePoint.Portal.WebControls.SearchBoxEx.  To customize small search, you need to inherit from "SearchBoxEx" class and override "CreateChildControls" method to get your custom small search rendered

If you would like to customize this Delegate control (within support boundries ) there are 2 ways.

Method 1

·         Create a custom master page by copying the default.master page

·         Copy/Paste "OSearchBasicFeature" in the same feature folder with a different name (like CustomSimpleSearch).

·         Change the feature ID in the feature.xml file within CustomSimpleSearch feature

·         Change the control ID in the SearchArea.xml file to something like "myCustomSearchcontrol".

·         Change the class & assembly referenced in the SearchArea.xml file to the control library you created above.

·         Install & Activate this feature

·         Render the custom control you created in the custom master page have and remove "SmallSearchInputBox" control from the master page

Method 2

Microsoft.SharePoint.PortalWebControls.SearchBoxEx class and you don't need to create a new control.
There are a large number of properties you can use to customize the control and you should find the one you're looking for

·         Create a new Feature (DelegateControl) under “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES”

·         Create a new manifest.xml in DelegateControl feature folder


<?xml version="1.0" encoding="utf-8"?>

<Solution xmlns:xsi=""






  <FeatureManifest Location="PortalSearch\feature.xml" />



·         Create a new feature.xml in DelegateControl feature folder


<?xml version="1.0" encoding="utf-8"?>

<Feature  Id="7095f774-1efa-4879-b074-ff211f5559c7"

          Title="Small Portal Search"

          Description="Smaller search bar without scopes"




          DefaultResourceFile="core"          xmlns="">


    <ElementManifest Location="elements.xml"/>   



·         Create a new elements.xml in DelegateControl feature folder


<?xml version="1.0" encoding="utf-8" ?>

<Elements xmlns="">





  ControlAssembly="Microsoft.SharePoint.Portal, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c">

  <Property Name="SearchResultPageURL">/search/results.aspx</Property>

  <Property Name="FrameType">None</Property>

  <Property Name="DropDownMode">HideDD_NoScope</Property>

  <Property Name="TextBoxWidth">140</Property>

  <Property Name="ShowAdvancedSearch">false</Property>



Install and activate the feature. Scope of this sample feature is Site level. You can modify it to reflect any scope.

The parameters I'm using set the "SearchResultPageURL", hide the scope drop down and remove the advance search link.

Comments (2)

  1. Register says:

    This blog has been created to share useful information. Thanks and greetings!

  2. nareshveergaoni says:

    Hi Pavan,  thanks for the great resource on search customization. I was trying to follow method 2 and unable to understand the step one, creating new feature could you please eloborate with the steps as to how do i create feature there. and the steps involved in this. much appriciate your help. thanks.

Skip to main content