<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Chris Forbes blogs on SharePoint &#38; .NET &#187; Delegates</title>
	<atom:link href="http://chrisforbesblogs.net/tag/delegates/feed/" rel="self" type="application/rss+xml" />
	<link>http://chrisforbesblogs.net</link>
	<description>Developers chat on SharePoint and .NET</description>
	<lastBuildDate>Tue, 08 May 2012 10:58:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='chrisforbesblogs.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/3aa4775025bad14a027d0ade34632a33?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Chris Forbes blogs on SharePoint &#38; .NET &#187; Delegates</title>
		<link>http://chrisforbesblogs.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://chrisforbesblogs.net/osd.xml" title="Chris Forbes blogs on SharePoint &#38; .NET" />
	<atom:link rel='hub' href='http://chrisforbesblogs.net/?pushpress=hub'/>
		<item>
		<title>How to create a Search Box delegate in SharePoint</title>
		<link>http://chrisforbesblogs.net/2009/11/09/how-to-create-a-search-box-delegate-in-sharepoint/</link>
		<comments>http://chrisforbesblogs.net/2009/11/09/how-to-create-a-search-box-delegate-in-sharepoint/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 20:37:18 +0000</pubDate>
		<dc:creator>Chris Forbes</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Delegates]]></category>
		<category><![CDATA[Search]]></category>

		<guid isPermaLink="false">http://chrisforbesblogs.wordpress.com/2009/11/09/how-to-create-a-search-box-delegate-in-sharepoint/</guid>
		<description><![CDATA[Simple but effective…I recently had to change the behaviour of the ‘SmallSearchBox’ control within&#160; SharePoint. I wanted to loose the ‘Advanced Search;’ link, the button style and also add some default text into the search box. I found the following method to be the simplest approach. Standard Search Box &#160; Custom delegate applied The search [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisforbesblogs.net&#038;blog=6742676&#038;post=94&#038;subd=chrisforbesblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://chrisforbesblogs.files.wordpress.com/2009/11/search48x48.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;margin:0 15px 0 0;" title="Search-48x48" border="0" alt="Search-48x48" align="left" src="http://chrisforbesblogs.files.wordpress.com/2009/11/search48x48_thumb.png?w=48&h=48" width="48" height="48" /></a>Simple but effective…I recently had to change the behaviour of the ‘SmallSearchBox’ control within&#160; SharePoint. I wanted to loose the ‘Advanced Search;’ link, the button style and also add some default text into the search box. I found the following method to be the simplest approach.</p>
<p><em>Standard Search Box</em></p>
<p> <a href="http://chrisforbesblogs.files.wordpress.com/2009/11/image.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://chrisforbesblogs.files.wordpress.com/2009/11/image_thumb.png?w=469&h=176" width="469" height="176" /></a></p>
<p>&#160;</p>
<p><em>Custom delegate applied</em></p>
<p style="font-family:tahoma;font-size:10pt;margin:0;"><a href="http://chrisforbesblogs.files.wordpress.com/2009/11/image1.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://chrisforbesblogs.files.wordpress.com/2009/11/image_thumb1.png?w=460&h=149" width="460" height="149" /></a> </p>
<p>The search box is rendered using a delegate control. If you look at the master page you will see the delegate …</p>
<p>&lt;SharePoint:DelegateControl runat=”server” ControlId=” SmallSearchBox”&gt;</p>
<p>You can alter the behaviour of a delegate control by specifying a delegate with a smaller sequence number. I created the following delegate control within a standard feature…</p>
<p>Feature…</p>
<p style="margin:0 0 12pt;" class="MsoNormal"><span style="font-family:&quot;color:blue;font-size:10pt;">&lt;?</span><span style="font-family:&quot;color:#a31515;font-size:10pt;">xml</span><span style="font-family:&quot;color:blue;font-size:10pt;"> </span><span style="font-family:&quot;color:red;font-size:10pt;">version</span><span style="font-family:&quot;color:blue;font-size:10pt;">=</span><span style="font-family:&quot;font-size:10pt;"><font color="#000000">&quot;</font><span style="color:blue;">1.0</span><font color="#000000">&quot;</font><span style="color:blue;"> </span><span style="color:red;">encoding</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;">utf-8</span><font color="#000000">&quot;</font><span style="color:blue;">?&gt;       <br />&lt;</span><span style="color:#a31515;">Elements</span><span style="color:blue;"> </span><span style="color:red;">xmlns</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;"><a href="http://schemas.microsoft.com/sharepoint/"><font color="#0000ff">http://schemas.microsoft.com/sharepoint/</font></a></span><font color="#000000">&quot;</font><span style="color:blue;">&gt;</span></span></p>
<p> <span style="font-family:&quot;font-size:10pt;"><span style="color:blue;">
<p style="margin:0 0 12pt;" class="MsoNormal">&lt;</p>
<p>     <span style="color:#a31515;">Control</span><span style="color:blue;"> </span><span style="color:red;">Id</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;">SmallSearchInputBox</span><font color="#000000">&quot;</font><span style="color:blue;"> </span><span style="color:red;">Sequence</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;">10</span><font color="#000000">&quot;</font><span style="color:blue;"> </span></span>
<p style="margin:0 0 12pt;" class="MsoNormal"><span style="color:blue;"></span><span style="color:red;">ControlClass</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;">Microsoft.SharePoint.Portal.WebControls.SearchBoxEx</span><font color="#000000">&quot;</font><span style="color:blue;"> </span><span style="color:red;">ControlAssembly</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;">Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</span><font color="#000000">&quot;</font><span style="color:blue;">&gt;       <br />&lt;</span><span style="color:#a31515;">Property</span><span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;">GoImageUrl</span><font color="#000000">&quot;</font><span style="color:blue;">&gt;</span><font color="#000000">/_layouts/images/CFB/go.gif</font><span style="color:blue;">&lt;/</span><span style="color:#a31515;">Property</span><span style="color:blue;">&gt;       <br />&lt;</span><span style="color:#a31515;">Property</span><span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;">GoImageUrlRTL</span><font color="#000000">&quot;</font><span style="color:blue;">&gt;</span><font color="#000000">/_layouts/images/CFB/.gif</font><span style="color:blue;">&lt;/</span><span style="color:#a31515;">Property</span><span style="color:blue;">&gt;       <br />&lt;</span><span style="color:#a31515;">Property</span><span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;">GoImageActiveUrl</span><font color="#000000">&quot;</font><span style="color:blue;">&gt;</span><font color="#000000">/_layouts/images/CFB/go.gif</font><span style="color:blue;">&lt;/</span><span style="color:#a31515;">Property</span><span style="color:blue;">&gt;       <br />&lt;</span><span style="color:#a31515;">Property</span><span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;">GoImageActiveUrlRTL</span><font color="#000000">&quot;</font><span style="color:blue;">&gt;</span><font color="#000000">/_layouts/images/CFB/go.gif</font><span style="color:blue;">&lt;/</span><span style="color:#a31515;">Property</span><span style="color:blue;">&gt;       <br />&lt;</span><span style="color:#a31515;">Property</span><span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;">UseSiteDefaults</span><font color="#000000">&quot;</font><span style="color:blue;">&gt;</span><font color="#000000">true</font><span style="color:blue;">&lt;/</span><span style="color:#a31515;">Property</span><span style="color:blue;">&gt;       <br />&lt;</span><span style="color:#a31515;">Property</span><span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;">FrameType</span><font color="#000000">&quot;</font><span style="color:blue;">&gt;</span><font color="#000000">None</font><span style="color:blue;">&lt;/</span><span style="color:#a31515;">Property</span><span style="color:blue;">&gt;       </p>
<p>&lt;</span><span style="color:#a31515;">Property</span><span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;">ShowAdvancedSearch</span><font color="#000000">&quot;</font><span style="color:blue;">&gt;</span><font color="#000000">false</font><span style="color:blue;">&lt;/</span><span style="color:#a31515;">Property</span><span style="color:blue;">&gt;       <br />&lt;</span><span style="color:#a31515;">Property</span><span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;">QueryPromptString</span><font color="#000000">&quot;</font><span style="color:blue;">&gt;</span><font color="#000000">Search&#8230;</font><span style="color:blue;">&lt;/</span><span style="color:#a31515;">Property</span><span style="color:blue;">&gt;       <br />&lt;</span><span style="color:#a31515;">Property</span><span style="color:blue;"> </span><span style="color:red;">Name</span><span style="color:blue;">=</span><font color="#000000">&quot;</font><span style="color:blue;">DropDownMode</span><font color="#000000">&quot;</font><span style="color:blue;">&gt;</span><font color="#000000">HideDD_useDefaultScope</font><span style="color:blue;">&lt;/</span><span style="color:#a31515;">Property</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0 0 12pt;" class="MsoNormal"><span style="color:blue;"></span><span style="color:blue;">       <br />&lt;/</span><span style="color:#a31515;">Control</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0 0 12pt;" class="MsoNormal"><span style="color:blue;">&lt;/</span><span style="color:#a31515;">Elements</span><span style="color:blue;">&gt;</span>
</p>
<p> </span>
<p>Note the Sequence=”10” attribute of the Control element. WSS out of the box refers to a sequence number of 100 and MOSS overrides this with a sequence number of 50. So as long as your sequence number is lower than this then your settings will be applied.</p>
<p>The four changes I was concerned was</p>
<p>1. Remove the ‘advanced search’ link which is handled by&#160; the ‘ShowAdvancedSearch’ property, </p>
<p>2.Add some default text to the search box which is handcled by&#160; the QueryPromptString property </p>
<p>3. Remove the scope drop down field. The DropDownMode property with the enumuration value of HideDD_userDefaultScope sorts that one out.</p>
<p>4. Finally I changed the image to my own go.gif image. I also deployed this within the same feature to a sub directory called CFB within the 12 hive images folder.</p>
<p>For a complete listing of the available properties please refer to the following link on MSDN.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.portal.webcontrols.searchboxex_members.aspx">http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.portal.webcontrols.searchboxex_members.aspx</a></p>
<p>&#160;</p>
</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:27c59b84-c0bc-4633-86e5-85a264a53d3d" class="wlWriterEditableSmartContent">del.icio.us Tags: <a href="http://del.icio.us/popular/SharePoint" rel="tag">SharePoint</a>,<a href="http://del.icio.us/popular/SmallSearchBox" rel="tag">SmallSearchBox</a>,<a href="http://del.icio.us/popular/Delegate" rel="tag">Delegate</a>,<a href="http://del.icio.us/popular/Searchbox" rel="tag">Searchbox</a></div>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e9c7831d-ca6c-420b-bf2f-426a1f6ca2e2" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/SharePoint" rel="tag">SharePoint</a>,<a href="http://technorati.com/tags/SmallSearchBox" rel="tag">SmallSearchBox</a>,<a href="http://technorati.com/tags/Delegate" rel="tag">Delegate</a>,<a href="http://technorati.com/tags/Searchbox" rel="tag">Searchbox</a></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisforbesblogs.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisforbesblogs.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisforbesblogs.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisforbesblogs.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chrisforbesblogs.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisforbesblogs.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chrisforbesblogs.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisforbesblogs.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisforbesblogs.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisforbesblogs.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisforbesblogs.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisforbesblogs.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisforbesblogs.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisforbesblogs.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisforbesblogs.net&#038;blog=6742676&#038;post=94&#038;subd=chrisforbesblogs&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chrisforbesblogs.net/2009/11/09/how-to-create-a-search-box-delegate-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ed3e25ef8a88f8fff819a7722f1805a9?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">chrisforbesblogs</media:title>
		</media:content>

		<media:content url="http://chrisforbesblogs.files.wordpress.com/2009/11/search48x48_thumb.png" medium="image">
			<media:title type="html">Search-48x48</media:title>
		</media:content>

		<media:content url="http://chrisforbesblogs.files.wordpress.com/2009/11/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://chrisforbesblogs.files.wordpress.com/2009/11/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
	</channel>
</rss>
