checkboxfor

ASP.net MVC CheckBoxFor casting error

I have a EF entity that is tied to a SQL table that contains a bit field called "Active". I generate the Edit code from the T4 template, and the page inherits from the EF entity. At the bottom of the page, it generated a CheckBoxFor like this: <%= Html.CheckBoxFor(model => model.Active) %> I get the wonderful red squiggly under mode...

Setting html attribute that is reserved keyword in Html.CheckBoxFor in ASP.NET MVC

Hi, I am using the HtmlHelper to create a checkbox in my view like so: <%= Html.CheckBoxFor(model => model.SeatOnly, new { checked = "checked" })%> However, an error is being thrown as checked is a reserved keyword. I have found a couple of people saying that you must use the 'reserved word prefix' and simply put an uderscore in front ...