RadioButtonList SelectedItem总是第一个

时间:2010-08-12 08:53:07

标签: c# asp.net radiobuttonlist

我正在使用带有四个项目的简单radiobuttonlist,我启用了viewstate和postback但是无论我选择什么选项,它总是返回第一个值。

以下是代码:

<asp:RadioButtonList runat="server" AutoPostBack="true" 
     EnableViewState="true" OnSelectedIndexChanged="Changed" ID="rbSlots">
</asp:RadioButtonList>


ListItem item = new ListItem(starthour + " - " + stophour + ds.Tables[0].Rows[i]["LastName"].ToString(), ds.Tables[0].Rows[i]["xavid"] + "¤" + ds.Tables[0].Rows[i]["xuserid"]);

我有RadCalendar,其中SelectedDateChanged事件我填充了radlist

1 个答案:

答案 0 :(得分:2)

Vibralux感谢您的回复!

我现在修复它,我生成的列表项的VALUE不是唯一的错误,所以我只是为Listitem分配了唯一的值,它开始正常工作。

此致