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

Apple iPhone sending SMS automatically 00447786205094

SharePoint online hub navigation not updating for other users

Service Bus Gateway service stuck at Starting

How to move SharePoint list items to a folder and subfolders in the same list using C# programmatically?