asp.net mvc 3 - Bind radio button to single model preoperty in MVC3 -
how bind 2 radio buttons single model property in mvc using @html.radiobuttonfor()
in model:
public class mymodel { public bool? doyouagree { get; set; } } in view:
<label> @html.radiobuttonfor(m => m.doyouagree, false, new { id = "doyouagree_false" }) no </label> <label> @html.radiobuttonfor(m => m.doyouagree, true, new { id = "doyouagree_true" }) yes </label>
Comments
Post a Comment