asp:中继器内的单选按钮列表
我正在尝试在转发器内绑定单选按钮列表。
例如,我的输出将是:
Group1
Group1
Group1
Group2
Group2
Group2
Group3
Group3
Group3
我需要用户能够从每个组中仅选择 1 个项目,因此总共应选择 3 个项目。
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<asp:RadioButtonList runat="server" DataSource="<%# ((Outlet)Container.DataItem).OutletInformations %>" DataValueField="DateOfDelivery" DataTextField="DateOfDelivery" />
</ItemTemplate>
</asp:Repeater>
当 HTML 渲染出页面时,我有 3 个组,如上所述,这是完美的,但我的选择根本不起作用,一旦我从每个组中选择 1 个项目,我就无法再更改我的选择,任何帮助将不胜感激!
I am trying to bind a radiobutton list inside a repeater.
So for example my output will be :
Group1
Group1
Group1
Group2
Group2
Group2
Group3
Group3
Group3
I need the user to be able to select only 1 item from Each group, so in total 3 items should be selected.
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<asp:RadioButtonList runat="server" DataSource="<%# ((Outlet)Container.DataItem).OutletInformations %>" DataValueField="DateOfDelivery" DataTextField="DateOfDelivery" />
</ItemTemplate>
</asp:Repeater>
When the HTML renders out the page I have 3 groups as mentioned which is perfect but my selection is not working at all, as soon as I select 1 item from each group I cannot change my selection anymore, any help would be appreciated !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,您不能简单地这样做,因为组属性将像 clientID 一样生成。
但听说你可以找到解决方案
http://www.codeproject.com/KB/webforms/How_group_RButtons.aspx
As i know you can not do that simply as this because Group attribute will be generate like clientID.
But hear you can find a solution
http://www.codeproject.com/KB/webforms/How_group_RButtons.aspx