[英]Radio button cant be clicked/checked
我正在尝试使用位于容器中的asp.net使用单选按钮,但是如果我选择了右单选按钮,即使单击了右单选按钮,左单选按钮也会被选中。
这是我的代码:
<asp:RadioButton ID="rdoSmallJars" Text="Small" runat="server" GroupName="measurementSystem" style="z-index: 1; left: 350px; top: -440px; position: absolute; height: 21px;" AutoPostBack="True"/>
<asp:RadioButton ID="rdo1" Text="Test" runat="server" GroupName="measurementSystem" style="z-index: 1; left: 450px; top: -440px; position: absolute; height: 21px;" AutoPostBack="True" />
有任何想法吗? 谢谢
您需要为每个单选按钮赋予一个值。 如果您不这样做,则它们将具有相同的默认值,单击它们中的任何一个都将等效于单击具有该值的第一个。
例如:
<asp:RadioButton Value="1" ID="rdoSmallJars" Text="Small" runat="server" GroupName="measurementSystem" style="z-index: 1; left: 350px; top: -440px; position: absolute; height: 21px;" AutoPostBack="True"/>
<asp:RadioButton Value="2" ID="rdo1" Text="Test" runat="server" GroupName="measurementSystem" style="z-index: 1; left: 450px; top: -440px; position: absolute; height: 21px;" AutoPostBack="True" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.