【发布时间】:2011-09-24 22:06:45
【问题描述】:
<asp:TemplateField HeaderText="Select One">
<ItemTemplate>
<asp:RadioButton ID="RadioButton1" runat="server" />
</ItemTemplate>
</asp:TemplateField>
aspx.cs
protected void Button1_Click(object sender, EventArgs e)
{
foreach (GridViewRow di in GridView1.Rows)
{
RadioButton rad = (RadioButton)di.FindControl("RadioButton1");
if (rad.Checked&&rad!=null)
{
s = di.Cells[1].Text;
}
}
Response.Redirect("applicants.aspx?form=" +s);
}
我正在选择用这个选择的行,但我在这里遇到问题我希望用户只能选择一个radiobutton,但它允许一次选择所有radiobuttons。你能请帮我解决这个问题。
请。
【问题讨论】:
标签: c# asp.net gridview radio-button