title: custom toolbar for sharepoint list
body: <p>I try to implement custom viewtoolbar for list template. I create customdefaulttemplate.ascx file under /TEMPLATES/CONTROLTEMPLATES. Code in customdefaulttemplate.ascx:</p>
  
  <pre><code>&lt;....&gt;
  &lt;%@ Register TagPrefix="CustomSurvey" Assembly="HideRespondToSurvey, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d6553d11ff33f7e" Namespace="HideRespondToSurvey.code"%&gt;
  &lt;SharePoint:RenderingTemplate ID="CustomViewToolBar" runat="server"&gt;
      &lt;Template&gt;
          &lt;wssuc:ToolBar CssClass="ms-menutoolbar" EnableViewState="false" id="toolBarTbl" ButtonSeparator="&lt;img src='/_layouts/images/blank.gif' alt='' /&gt;" RightButtonSeparator="&amp;#160;&amp;#160;&amp;#160;" runat="server"&gt;
              &lt;Template_Buttons&gt;
                  &lt;CustomSurvey:SurveyMenu runat="server"&gt;&lt;/CustomSurvey:SurveyMenu&gt;
              &lt;/Template_Buttons&gt;
              &lt;Template_RightButtons&gt;
                    &lt;SharePoint:PagingButton runat="server"/&gt;
                    &lt;SharePoint:ListViewSelector runat="server"/&gt;
              &lt;/Template_RightButtons&gt;
          &lt;/wssuc:ToolBar&gt;
      &lt;/Template&gt;
  &lt;/SharePoint:RenderingTemplate&gt;
  </code></pre>
  
  <p>I create class SurveyMenu that inherit from Microsoft.SharePoint.WebControls.NewMenu and in CreateChildControls() I placed my logic. In list schema template under "View" I set  ToolBarTemplate="CustomViewToolBar". My list is the survey list, but it has addition fields and event receivers logic. It has unique type in ListTemplate definition. I deploy list using feature, create list instance on the site but my toolbar isn't appear. I create this toolbar using methods described <a href="http://blogs.msdn.com/b/pavankumar/archive/2010/03/19/how-to-hide-respond-to-this-survey-when-a-user-has-already-responded-to-the-survey.aspx" rel="nofollow">here</a> and <a href="http://blogs.msdn.com/b/syedi/archive/2009/12/04/customizing-the-list-toolbar-template-wss-3-0-moss.aspx" rel="nofollow">here</a>, but it doesn't work.    </p>
  
  <p>May be you can take some useful resources about this topic, or make assumption why it may not to work.  Thanks.</p>