Hey, I really couldn't get these methods to work. Setting the value of the "checked" attribute to an empty string still leads to the checkbox in IE. My solution was to add the HtmlHelper extension:
public static string SimpleCheckbox(this HtmlHelper helper,
string name,
string value,
bool isChecked)
{
return String.Format("<input type=\"checkbox\" name=\"{0}\" value=\"{1}\" " + (isChecked ? "checked" : "") + "/>", name, value);
}
And in the markup:
<%= Html.SimpleCheckbox("checkboxId", item.Id, item.IsSelected) %>
source
share