Templates sharepoint列表的自定义工具栏
我尝试为列表模板实现自定义viewtoolbar。我在/TEMPLATES/CONTROLTEMPLATES下创建customdefaulttemplate.ascx文件。customdefaulttemplate.ascx中的代码:Templates sharepoint列表的自定义工具栏,templates,sharepoint-2010,toolbar,custom-lists,Templates,Sharepoint 2010,Toolbar,Custom Lists,我尝试为列表模板实现自定义viewtoolbar。我在/TEMPLATES/CONTROLTEMPLATES下创建customdefaulttemplate.ascx文件。customdefaulttemplate.ascx中的代码: <....> <%@ Register TagPrefix="CustomSurvey" Assembly="HideRespondToSurvey, Version=1.0.0.0, Culture=neutral, PublicKeyToke
<....>
<%@ Register TagPrefix="CustomSurvey" Assembly="HideRespondToSurvey, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d6553d11ff33f7e" Namespace="HideRespondToSurvey.code"%>
<SharePoint:RenderingTemplate ID="CustomViewToolBar" runat="server">
<Template>
<wssuc:ToolBar CssClass="ms-menutoolbar" EnableViewState="false" id="toolBarTbl" ButtonSeparator="<img src='/_layouts/images/blank.gif' alt='' />" RightButtonSeparator="   " runat="server">
<Template_Buttons>
<CustomSurvey:SurveyMenu runat="server"></CustomSurvey:SurveyMenu>
</Template_Buttons>
<Template_RightButtons>
<SharePoint:PagingButton runat="server"/>
<SharePoint:ListViewSelector runat="server"/>
</Template_RightButtons>
</wssuc:ToolBar>
</Template>
</SharePoint:RenderingTemplate>
我创建了从Microsoft.SharePoint.WebControl.NewMenu继承的类SurveyMenu,并在CreateChildControls()中放置了我的逻辑。在“视图”下的列表模式模板中,我设置了ToolBarTemplate=“CustomViewToolBar”。我的列表是调查列表,但它有附加字段和事件接收器逻辑。它在ListTemplate定义中具有唯一的类型。我使用功能部署列表,在站点上创建列表实例,但我的工具栏不显示。我使用描述的方法和创建此工具栏,但它不起作用
也许你可以利用一些关于这个主题的有用资源,或者假设为什么它可能不起作用。谢谢。您是否考虑过在UI功能区上创建自定义操作?我已经做了一些事情,您可以将其应用于所有列表,一些您指定的列表,并且您不必经历在页面上创建和放置web部件的痛苦