How do I set a checkbox in razor view?

I need to check a checkbox by default:

I tried all of these, nothing is checking my checkbox -

@Html.CheckBoxFor(m => m.AllowRating, new { @value = "true" })

@Html.CheckBoxFor(m => m.AllowRating, new { @checked = "true" })

@Html.CheckBoxFor(m => m.AllowRating, new { @checked = true })

@Html.CheckBoxFor(m => m.AllowRating, new { @checked = "checked"})
35
задан kheya 27 May 2011 в 20:19
поделиться