I have model with bool property IsMale. In view i have table with values how i can change value?
I tried this:
<td>
@if (item.IsMale == true)
{
@Html.DisplayFor(modelItem => "Male")
}
else
{
@Html.DisplayFor(modelItem => "Female")
}
</td>
But im getting error:
Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.
And in create view how i can make radio buttons >Male >Female and return it in bool?