RadioButtonList问题,为什么有几个DataValueField的值一样的时候,选择状态就不能保持?总是跳到第一个一样值的那一项,怎么解决?

chenlm 2003-10-25 12:11:35
RadioButtonList问题,为什么有几个DataValueField的值一样的时候,选择状态就不能保持?总是跳到第一个一样值的那一项,怎么解决?

如:
<asp:RadioButtonList id="Radiobuttonlist1" Width="300px" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="2">asd</asp:ListItem> <asp:ListItem Value="1">asdasd</asp:ListItem> <asp:ListItem Value="asd">asd</asp:ListItem> <asp:ListItem Value="asdasd">asd</asp:ListItem> <asp:ListItem Value="1">asdd</asp:ListItem>
</asp:RadioButtonList>

选择第五个的时候点击按钮(该按钮不做任何事) doPostBack

选择状态就跳掉了第二项, 而点其他的就不会跳
为什么DataValueField不能一样?各位遇到这样的问题都是怎么解决的呢?
...全文
57 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
saucer 2003-10-25
  • 打赏
  • 举报
回复
try

18、 是否安装设备箱?(8%)
a.是(8分) b.否(0分) c.不要求(-8分)
chenlm 2003-10-25
  • 打赏
  • 举报
回复
18、 是否安装设备箱?(8%)
a.是(8分) b.否(0分) c.不要求(8分)

因为我想把分数放在DataValueFiled里面

<input id="DataGrid1__ctl4_DataGrid2__ctl5_radio1_0" type="radio" name="DataGrid1:_ctl4:DataGrid2:_ctl5:radio1" value="8" />

<input id="DataGrid1__ctl4_DataGrid2__ctl5_radio1_1" type="radio" name="DataGrid1:_ctl4:DataGrid2:_ctl5:radio1" value="0" />

<input id="DataGrid1__ctl4_DataGrid2__ctl5_radio1_2" type="radio" name="DataGrid1:_ctl4:DataGrid2:_ctl5:radio1" value="8" />

saucer 2003-10-25
  • 打赏
  • 举报
回复
when you select on the 5th radio box, something like

Radiobuttonlist1=1

is sent back, how could the server side know whether it is the second one or the fifth one that is selected??

also, logically, why do you want your radio boxes to have a same value??

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧