惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
H
Help Net Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Vulnerabilities – Threatpost
MongoDB | Blog
MongoDB | Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
A
Arctic Wolf
The GitHub Blog
The GitHub Blog
Security Latest
Security Latest
G
GRAHAM CLULEY
Cyberwarzone
Cyberwarzone
S
Schneier on Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Privacy & Cybersecurity Law Blog
IT之家
IT之家
D
Darknet – Hacking Tools, Hacker News & Cyber Security
博客园 - 聂微东
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
The Hacker News
The Hacker News
B
Blog RSS Feed
云风的 BLOG
云风的 BLOG
Scott Helme
Scott Helme
P
Proofpoint News Feed
T
The Exploit Database - CXSecurity.com
L
LangChain Blog
F
Full Disclosure
I
Intezer
V
V2EX
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Spread Privacy
Spread Privacy
美团技术团队
Engineering at Meta
Engineering at Meta
C
Cybersecurity and Infrastructure Security Agency CISA
罗磊的独立博客
T
Tenable Blog
D
DataBreaches.Net
M
MIT News - Artificial intelligence
S
Securelist
C
CERT Recently Published Vulnerability Notes
Recent Announcements
Recent Announcements
Microsoft Azure Blog
Microsoft Azure Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
NISL@THU
NISL@THU
The Register - Security
The Register - Security
L
LINUX DO - 热门话题
P
Palo Alto Networks Blog

博客园 - 皮皮@北京

最牛比的IE。。 微软于周一正式公布了下一个版本的SharePoint服务器版本的初步系统要求 讨厌的K2变化ProcessInstance.DataFields - 皮皮@北京 - 博客园 安装SQL Server 2008 及 VS 2008(转自邹建老大的blog) Windows SharePoint Services 3.0 通用参考中文版 Microsoft Office SharePoint Server 2007 通用参考中文版 避免Webpart Page的URL地址中带ID参数的问题 用js改变MOSS自带的一些按钮的默认事件 K2中的任务代理 [转]大学厕所里爆笑接龙(好久没更新了啊。。) 解决:K2.net Studio 遇到问题需要关闭 K2 BlackPearl中日志记录的设置与扩展 The Sharepoint 2007 Song WorkflowManagementHostServer Not Hosted! 用ddwrt:URLLookup在列表自定义页面中显示查阅项的链接 SharePoint Permissions Matrix 记录中心设置 如何给SPListItem中DateTime类型的Field赋空值 巨爆笑~
自定义MOSS搜索框
皮皮@北京 · 2009-06-13 · via 博客园 - 皮皮@北京

自定义母板页的时候,免不了有时候会需要对网页右上角那个搜索框有点需求,比如那个下拉框太长我想让它宽度变小点

开始有这个需求的时候,我是用修改CSS来实现的,不过修改CSS是件挺麻烦的事,后来发现了使用DelegateControl可以很好的实现。

具体实现:

创建Feature,实现DelegateControl。

Feature.xml

1 <?xml version="1.0" encoding="utf-8" ?>
2 <Feature Title="xxx" Description="xxx Controls" Id="B52ABDB5-601E-4847-A8BA-6D3AF5067B5F" Scope="Farm" Hidden="TRUE" AlwaysForceInstall="TRUE" xmlns="http://schemas.microsoft.com/sharepoint/">
3   <ElementManifests>
4     <ElementManifest Location="Controls.xml" />
5   </ElementManifests>
6 </Feature>

Controls.xml

 1 <?xml version="1.0" encoding="utf-8" ?>
 2 <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
 3     <Control Id="MySearchInputBox" Sequence="50" ControlClass="Microsoft.SharePoint.Portal.WebControls.SearchBoxEx" ControlAssembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
 4     <Property Name="GoImageUrl">/_layouts/images/gosearch.gif</Property>
 5     <Property Name="GoImageUrlRTL">/_layouts/images/goRTL.gif</Property>
 6     <Property Name="GoImageActiveUrl">/_layouts/images/gosearch.gif</Property>
 7     <Property Name="GoImageActiveUrlRTL">/_layouts/images/goRTL.gif</Property>
 8     <Property Name="DropDownMode">ShowDD</Property>
 9     <Property Name="DropDownWidth">100</Property>
10     <Property Name="TextBoxWidth">100</Property>
11     <Property Name="SearchResultPageURL">/Pages/SearchResult.aspx</Property>
12     <Property Name="ScopeDisplayGroupName">搜索下拉列表</Property>
13     <Property Name="FrameType">None</Property>
14     <Property Name="ShowAdvancedSearch">true</Property>
15   </Control>
16 </Elements>

MasterPage

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

可以看出来,下拉框控件有很多的属性实现相应的功能,这些属性与搜索框webpart对应的属性是一样的

这样就可以很好的定制母板页中的搜索框了。