J'espère que vous pourrez m'aider. Cela m'a dérangé pendant des heures.Liste des boutons radio L'élément est toujours faux
J'ai une liste RadioButton dans ma page CustomerGroupConfirm.aspx:
<div>
<table>
<tbody>
<tr>
<td nowrap="nowrap">
<asp:RadioButtonList ID="rblContractGroups" runat="server"></asp:RadioButtonList>
</td>
</tr>
<tr>
<td nowrap="nowrap">
<br />
<asp:Button ID="btnConfirmCustomerContractGroups" runat="server" OnClick="confirmCustomerContractGroups_Click" CssClass="Button" Text="Confirm Default Customer Contract Group" />
</td>
</tr>
</tbody>
</table>
</div>
je choisis un RadioButton et quand je clique sur le bouton « Confirmer groupe de contact par défaut client » est la fonction ici dans le code derrière lequel incendies:
protected void confirmCustomerContractGroups_Click(object sender, EventArgs e)
{
// Iterate through the Radio Button list.
foreach (ListItem li in rblContractGroups.Items)
{
if (li.Selected)
// If the Radio Button List Item (Customer Contract Group) is Selected.
{
// Set the Default Customer Contract Group of the Current User.
CustomerAccess.SetDefaultCustomerContractGroup(Int32.Parse(Session["CustomerID"].ToString()), Int32.Parse(li.Value));
}
}
Response.Redirect("~/Default.aspx");
}
Le problème est que l'élément de liste (li.Sélectionné) est toujours faux.
Qu'est-ce que je fais mal? Quelqu'un peut-il aider s'il vous plaît.
Cordialement
Walter
Vous avez absolument raison. Merci beaucoup. –