Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

How can i Set RadioButtonFor() as Checked By Default

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

there is way out for (Html.RadioButton) but not for (Html.RadioButtonFor)

any Ideas?

like image 340
coolguy97 Avatar asked Apr 08 '10 09:04

coolguy97


1 Answers

Use the simple way:

<%= Html.RadioButtonFor(m => m.Gender, "Male", new { Checked = "checked" })%> 
like image 113
Gabriel Militello Avatar answered Sep 21 '22 20:09

Gabriel Militello