Wss3sdk How to customize a delegate control

Source: Internet
Author: User
Tags xmlns

Steps

By copying the default \template\features\contentlightup folder, Local_drive:/program files/common files/microsoft Shared/web Server Create a folder named Newsearchbox under Extensions/12/template/features.

Xml

<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="GUID"
Title="New Search Image"
Description="Points at which third partIEs light up in content pages"
Version="12.0.0.0"
Scope="WebApplication"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="controls\searcharea.xml" />
</ElementManifests>
</Feature>

In the Newsearchbox folder, modify the existing Feature.xml file by running Guidgen.exe (located in local_drive:\program Files\Microsoft Visual Studio 8\common 7\tools) to generate a new GUID.

In the controls file, modify the Searcharea.xml file, which references a replaceable. ascx file, as follows.

Xml

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Control
Id="SmallSearchInputBox"
Sequence="100"
ControlSrc="~/_controltemplates/mySearchArea.ascx">
<Property Name="SearchTextToolTip">Search this site</Property>
<Property Name="SearchImageToolTip">Go</Property>
</Control>
</Elements>

Under \template\controltemplates, copy the Searcharea.ascx file and rename the copied file as Mysearcharea.ascx.

At the end of your copy of the. ascx file, locate the tag and modify its SRC attribute to point to the replacement picture file. To test, you can use the default picture file installed under \template\images, in the following example, the simple replacement of the original gosearch.gif with Folder.gif.

<INPUT Type=TEXT id='idSearchString' size=25 style='vertical-align: 2' name='SearchString' display='inline' maxlength=255 ACCESSKEY=S class='ms-searchbox' onKeyDown="return SearchKeyDown(event, <%=strEncodedUrl%>);" title=<%SPHttpUtility.AddQuote(SPHttpUtility.HTMLEncode(SearchTextToolTip),Response.Output);%>>

<a target='_self' href='javascript:' onClick="javascript:SubmitSearchRedirect(<%=strEncodedUrl%>);javascript:return false;" title=<%SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SearchImageToolTip),Response.Output);%> ACCESSKEY=O ID=onetIDGoSearch>
></a>
&nbsp;
</span>
</nobr>

On the command line, enter the following command to install and activate the feature on a specific subsite.

A. Stsadm-o installfeature-filename newsearchbox\feature.xml

B. Stsadm-o Activatefeature-filename Newsearchbox\feature.xml-url Http://Server/Site/Subsite

Navigate to the subsite to see changes to the picture on the right side of the search box.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.