I have a view in which users enter their primary phone number and then their mobile number and selects a radio button on which number he prefers to be contacted on.
this is my code....
/*<div class="form-group col-md-3">
@Html.Label("First Name")
@Html.TextBoxFor(m => m.FirstName)
</div>
<div class="form-group col-md-3">
@Html.Label("Last Name")
@Html.TextBoxFor(m => m.LastName)
</div>*/
<div>
@Html.Label("Primary Number")
@Html.TextBoxFor(m => m.PrimaryNumber)
@Html.RadioButtonFor(m => m.Contact, null)
</div>
<div>
@Html.LabelFor(m => m.Mobile)
@Html.TextBoxFor(m => m.Mobile)
@Html.RadioButtonFor(m => m.Contact, null)
</div>
And this is my Model (simplified)
Public class Customer{
//public string FirstName { get; set; }
//public string LastName { get; set; }
public string PrimaryNumber { get; set; }
public string Mobile { get; set; }
public string Contact { get; set; }
}
My problem is like this, how to I set the string value of the radio button to the input of the customer in the appropriate text box (in order for me to set it to the "Contact" property in my model)