In a view I have two <input type="radio">, combine they make a radio group.
I want to bind them with a field of Model, in a way if value is true it should bind first radio button if false it should bind the other.
Please guide how it can be achived. I tried below code but it always checked the second radio no matter what value model has.
<div class="radiobuttons">
<input type="radio" name="LenderType" checked="@Model.Filter_Value" id="rbtnAllLenders" class="cb">
<input type="radio" id="rbtnMajorLendersOnly" checked="[email protected]_Value" name="LenderType" class="cb">
</div>
The input typed as radio needs to have a value set. If the radio is checked, then the value is what is sent for the name in the model.
view model
input element