3
我有一個ListView,裏面有一個複選框字段,它動態獲取id集。檢查listview內的複選框的值
我也有一個按鈕,當按下時需要檢查是否有任何checboxes已被檢查,但我不知道如何完成這項工作。
有關如何完成此任務的任何想法?
感謝
這是我的代碼:
<asp:ListView ID="ListView1" runat="server" DataKeyNames="Id"
DataSourceID="EntityDataSource1" EnableModelValidation="True">
<ItemTemplate>
<tr>
<td class="firstcol">
<input id='Checkbox<%# Eval("Id") %>' type="checkbox" />
</td>
</tr>
</ItemTemplate>
<LayoutTemplate>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="50" scope="col" class="firstcol">
</th>
</tr>
<tr ID="itemPlaceholder" runat="server"></tr>
</table>
<asp:Button ID="btnDownload" runat="server" Text="Download" Height="26px"
onclick="btnDownload_Click" />
</LayoutTemplate>
</asp:ListView>
protected void btnDownload_Click(object sender, EventArgs e)
{
???????
}