I have this Radiobutton:
<asp:RadioButtonList ID="rdlCpfCnpjFornecedorBemNovo" CssClass="cPFCNPJRadioButtonList" runat="server" RepeatDirection="Horizontal" AutoPostBack="false" RepeatLayout="Flow">
<asp:ListItem Text="CPF " Value="1"></asp:ListItem>
<asp:ListItem Text="CNPJ " Value="2"></asp:ListItem>
</asp:RadioButtonList>
In the code I have this:
rdlCpfCnpjFornecedorBemNovo.SelectedValue = ventBensAquisicao.TipoPessoa.ToString();
It turns out that when selectedvalue == 2
, it does not, it continues with CPF
checked and not CNPJ
. I've tried other things besides SelectedValue
, but nothing. I need to set according to what comes from the bank, that is, 1 or 2. What is wrong that does not work?