0
Follows 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 just brings me the value = 1
. These selected = true
, are my attempts.
int teste = int.Parse(rdlCpfCnpjAvalista.SelectedValue);
Test is always equal to 1.
what do you have
Selected="True"
? It thus fetches the value of the first selected, in this case, the value 1– CesarMiguel
But if I leave nothing is happening the same thing. This Selected, as I said, are already the tests that I have been doing.
– pnet
I just tested, it worked normal, where you’re putting this event to capture the value?
– Laerte
At the Click of the Button.
– pnet
Tested here: http://i.stack.Imgur.com/2ME3B.png
– Laerte
With me it’s not working. Only comes Value = 1
– pnet
I solved it. The question and I don’t know why, when I posted it here, the boxes were reversed. It’s just how are the names. should be this rdlCPCNPJAvalist and the colleague left so: rdlCpfCnpjAvalist
– pnet