如何在表格中使用 复选框(checkBox) 一行一个复选框
在asp.net2.0中如何在表格中一行一个复选框.怎么识别呢,有高手可以附代码吗? --------------------编程问答-------------------- 用 CheckBox 列啊到时候要遍历GridView.Rows --------------------编程问答-------------------- 你这个表格是指什么
gridview,repeater,datalist 只要加一个 <asp:CheckBox ID="CheckBox1" runat="server" />
--------------------编程问答--------------------
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
{
int intRowCount = this.GridView1.Rows.Count;
string strInfo = string.Empty;
for (int i = 0; i < intRowCount; i++)
{
CheckBox chk = (CheckBox) this.GridView1.Rows.Cells.FindControl("chkDelete");
if (chk.Checked)
{
this.GridView1.Rows.Visible = false;
strInfo += this.GridView1.Rows.Cells.Text + "被选中." + "<br/>";
}
}
this.lblInfo.Text = strInfo;
}
--------------------编程问答-------------------- 以上为CheckBox的遍历代码
补充:.NET技术 , ASP.NET