-1
我的代碼如下。在這裏有一個問題,我只想要選擇rdbtn5或任何一個電臺列表項。但它可以同時選擇。請建議。單選按鈕列表和單選按鈕asp.net
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="70%" style="padding-left:10px; text-decoration-color:white">
<div class="content" style="display: inline-block !important;">
<asp:RadioButton ForeColor="White" ID="rdContribute" AutoPostBack="true" OnCheckedChanged="rdContribute_CheckedChanged" Text="abc"<br/> GroupName="RadioGroup1" runat="server" /><!--onchange="Monthly()" -->
<div style="display:block;margin-left:10px;" id="dvrdList">
<asp:RadioButtonList ID="rdlist" ForeColor="White" GroupName="Selected1" runat="server">
<asp:ListItem Text="Rs.100/month(Rs.1200/Year)" Value="100" name="abc" Selected="True"></asp:ListItem>
<asp:ListItem Text="R.250/month(Rs.3000/Year)" Value="250" name="abc"></asp:ListItem>
<asp:ListItem Text="Rs.500/month(Rs.6000/Year)" Value="500" name="abc"></asp:ListItem>
<asp:ListItem Text="Rs.1000/month(Rs.12000/Year)" Value="1000" name="abc"></asp:ListItem>
<asp:ListItem Text="Rs.5000/month(Rs.60000/Year)" Value="5000" name="abc"></asp:ListItem>
</asp:RadioButtonList>
<asp:RadioButton runat="server" ID="rdbtn5" name="abc" AutoPostBack="true" OnCheckedChanged="rdContribute_CheckedChanged" GroupName="Selected1"/><asp:TextBox ID="tbGreater" runat="server" onkeypress="return isNumberKey(event)" CausesValidation="true" Enabled="false"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator1" Type="Integer" MinimumValue="1000" MaximumValue="1000000" ControlToValidate="tbGreater" runat="server" ErrorMessage="Enter digits greater than 1000"></asp:RangeValidator>
</div>
<asp:RadioButton ForeColor="White" ID="rdNo" AutoPostBack="true" Text="I do not wish to make a contribution" OnCheckedChanged="rdNo_CheckedChanged" GroupName="RadioGroup1" runat="server" />
</div>
</td>
</tr>
<tr>
<td>
<asp:RadioButton ForeColor="White" ID="rdReminder" AutoPostBack="true" name="rdReminder" Visible="false" OnCheckedChanged="rdReminder_CheckedChanged" Text="def" GroupName="RadioGroup1" runat="server" />
</td>
</table>
這隻有一次。選擇rdbtn5後,如果我點擊任何其他Rdlist項目,同樣的問題發生 –
更新我的答案。您可能需要稍微調整一下以使其適用於您的情況。 – VDWWD
謝謝..它工作:) –