Follow the code:
<asp:RadioButtonList ID="rdlCpfCnpjAvalista" CssClass="cPFCNPJRadioButtonList" runat="server" RepeatDirection="Horizontal" AutoPostBack="false">
<asp:ListItem Text="CPF" Value="1" Selected="True"></asp:ListItem>
<asp:ListItem Text="CNPJ" Value="2" Selected="True"></asp:ListItem>
</asp:RadioButtonList>
Any choice I make, it only brings me value = 1
. These selected = true
, are my attempts.
int teste = int.Parse(rdlCpfCnpjAvalista.SelectedValue);
Test is always equal to 1.