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)
{
???????
}