Default Sequence Value for the SmallSearchInputBox

Tags: .NET, Development, SharePoint 2010

I’ve been tampering with the SmallSearchInputBox control in SharePoint 2010. Well, not directly. I’ve been working to replace the default SmallSearchInputBox delegate control built into SharePoint 2010 with my own custom delegate control. The process seems pretty straightforward, but I was not seeing my custom delegate control. I double and triple-checked my code and everything looked perfect, but still no luck. I found that the problem was the sequence number I was using for my control.

In the SDK documentation for SharePoint 2010 (along with other online resources I came across), the default sequence number of the SmallSearchInputBox delegate control is listed as 100. As you may or may not know, delegate controls with a lower sequence number take precedence. So, I deployed my custom delegate control with a sequence number of 99. That should do it, right? Nope. After spending some time in frustration-land, I decided to test a variety of sequence numbers and I found that anything below 25 seems to work. So that leads me to believe that the default sequence number of SharePoint 2010′s built-in SmallSearchInputBox delegate control is 25.

Has anyone else confirmed that?

For reference, here are my code snippets.

Feature.xml

1:  <?xml version=”1.0″ encoding=”utf-8″?>
2:  <Feature xmlns=”http://schemas.microsoft.com/sharepoint/” Description=”Replaces the SmallSearchInputBox with a Label” Id=”87dc3abb-d323-4320-aae8-c79a51e45590″ Scope=”Farm” Title=”Custom Delegate Control”>
3:    <ElementManifests>
4:      <ElementManifest Location=”Elements.xml” />
5:    </ElementManifests>
6:  </Feature>

Elements.xml (notice the sequence number here…this is what I’m referring to…it seems that is has to be in the 0-24 range)

1:  <?xml version=”1.0″ encoding=”utf-8″?>
2:  <Elements xmlns=”http://schemas.microsoft.com/sharepoint/“>
3:    <Control Id=”SmallSearchInputBox” Sequence=”0″ ControlSrc=”~/_ControlTemplates/SharePointProject4/UserControl1.ascx” />
4:  </Elements>

UserControl1.ascx (I did not include the @Register/@Import/@Control directives in this snippet)

1:  <asp:Label ID=”Label1″ runat=”server” Text=”Eric Skaggs’ Custom Delegate Control” />