0
I have this Radiolist declared:
<label>Aprovar</label>
<asp:RadioButtonList ID="rblAprovar" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
<asp:ListItem Text=" Sim " Value="1" />
<asp:ListItem Text=" Não " Value="0" />
</asp:RadioButtonList>
And I have this command in my Behind:
if(rblAprovar.SelectedIndex = -1)
{
vstrMensagem += "- Aprovar não informado.<br>";
}
This is making this mistake:
Cannot implicitly Convert 'int' to 'bool'
I have other Radiobuttonlist with the same if that does not give this error and that they are being programmed in the same way. The question is: What could be wrong with that statement? In my opinion nothing.
Missed the ==...
if(rblAprovar.SelectedIndex == -1)
– Diego Zanardo