如何在数据列表控件中使用单选按钮
问题描述:
我需要使用数据列表控件中的单选按钮.
但是它不能正常工作,因为有多个选择.
I have the requirement of using the radio buttons inside the data list control.
but it is not working as there are multiple selections.
how to use it so that there is only single selection?
答
<asp:DataList ID="DataList1" runat="server" DataKeyField="NationalityID"
DataSourceID="SqlDataSource1" onitemdatabound="DataList1_ItemDataBound">
<ItemTemplate>
Nationality:
<asp:Label ID="NationalityLabel" runat="server"
Text='<%# Eval("Nationality") %>' />
<br />
<br />
<asp:RadioButton ID="RadioButton1" runat="server"/>
</ItemTemplate>
</asp:DataList>
检查此链接:
http://forums.asp.net/t/1648577.aspx
Check this link :
http://forums.asp.net/t/1648577.aspx
选中此
http://www.codeproject.com/Articles/7960/How-to-group-RadioButtons
check this
http://www.codeproject.com/Articles/7960/How-to-group-RadioButtons