How to Set RadioButtonFor() in ASp.net MVC 2 as Checked by default

前端 未结 14 1866
一向
一向 2021-02-06 21:20

How can i Set RadioButtonFor() as Checked By Default

<%=Html.RadioButtonFor(m => m.Gender,\"Male\")%>

there is way out for (Html.Radio

14条回答
  •  南笙
    南笙 (楼主)
    2021-02-06 21:44

               @Html.RadioButton("Insured.GenderType", 1, (Model.Insured.GenderType == 1 ))
               @Web.Mvc.Claims.Resources.PartyResource.MaleLabel
               @Html.RadioButton("Insured.GenderType", 2, Model.Insured.GenderType == 2)
               @Web.Mvc.Claims.Resources.PartyResource.FemaleLabel
    

提交回复
热议问题