<input id="Radio1" type="radio" runat="server" class="by_ bn_" value="I" /><span class="v_">123</span>
<input id="Radio2" type="radio" runat="server" class="by_ bn_" value="O" /><span class="v_">456</span>
string LX = ""; if (Radio1.Checked) { LX =Radio1.Value.ToString(); } else if(Radio2.Checked) { LX = Radio2.Value.ToString(); }
前台我选择了radio1,我断点看到radio1.checked=false,不知道是什么问题。
<input name="radio" id="Radio1" type="radio" runat="server" class="by_ bn_" value="I" /><span class="v_">123</span> <input name="radio" id="Radio2" type="radio" runat="server" class="by_ bn_" value="O" /><span class="v_">456</span>
加了name属性
去掉也没用,我page_load里也有if(!IsPostback)啊
@Ole_Yao: 我这边是有效果的,不是去掉,是加上,跟if(!IsPostback)没有任何的关系
控件默认是false的,
<input name="radio" id="Radio1" type="radio" runat="server" class="by_ bn_" value="I" checked="checked" /><span class="v_">123</span>
添加黄色背景的属性