How to check the radio button in mvc 3 when its bounded to a single boolean value

Hi
Here i'll tell you how to check the radio button in mvc 3 when its bounded to a single boolean value.

@Html.RadioButtonFor(model => model.ContactType, "False", new { value = "Direct" })
 @Html.RadioButtonFor(model => model.ContactType, new { value = "Mail" })
 @Html.RadioButtonFor(model => model.ContactType, new { value = "Phone" })

Just pass the parameter "False" to your radio button and left others blank. If it does'nt work for you set all others "True" and any of them "False".

@Html.RadioButtonFor(model => model.ContactType, "False", new { value = "Direct" })
 @Html.RadioButtonFor(model => model.ContactType,"True", new { value = "Mail" })
 @Html.RadioButtonFor(model => model.ContactType, "True",new { value = "Phone" })


Thank You

Comments

Popular Posts

GREYCstoration Oil Paint plugin for Photoshop

Service Bus Gateway service stuck at Starting

PowerApps SubmitForm not clearing People Picker value

Apple iPhone sending SMS automatically 00447786205094

Download file failed signature verification and may have been tampered with - Workflow Manger 1.0 Refresh (CU2)