2013-01-13 81 views
1

我在網絡用戶控制中使用ListView來顯示調查格式中不同表格的數據,用戶必須給出答案,即從多個選項中進行選擇或在TextBox中給出他自己的意見,我想在ListView'數據尋呼機將作爲一個提交按鈕?如何顯示自定義按鈕?

我不知道該怎麼做?任何人的幫助將不勝感激。

+0

每行添加一個按鈕或只是一個在底部? – Stokedout

+0

但我想通過ListView – Sheery

回答

0

您可以修改ListViewLayoutTemplateListView尋呼機:

<asp:ListView runat="server" ID="ListView1" 
    DataSourceID="SqlDataSource1"> 
    <LayoutTemplate> 
     <table runat="server" id=" table1"> 
      <tr runat="server" id="itemPlaceholder"> 
      </tr> 
     </table> 
     <!-- This is the pager. Define all necessary markup here. --> 
     <asp:DataPager runat="server" ID="DataPager" PageSize="5"> 
      <Fields> 
       <asp:TemplatePagerField>    
        <PagerTemplate> 
         <!-- Pager template goes here --> 
        </PagerTemplate> 
       </asp:TemplatePagerField> 
      </Fields> 
     </asp:DataPager> 
    </LayoutTemplate> 
</asp:ListView> 
+0

處理它,但自定義按鈕在哪裏?據我所知,你只能在Fields標籤的數據分頁器中添加NEXT,PREVIOUS,BACK按鈕?但如何添加一個自定義按鈕,可以用作提交按鈕 – Sheery

+0

@Sheery你可以有一個templatepagerfiled。我正在更新答案。 –

+0

非常感謝@Konstantin D - Infragistics,還有一件事我在中添加了一個按鈕btn_Submit,但無法找到它的Click事件,請指導我如何添加btn_Submit的點擊事件? – Sheery