Checkbox Disabled Attribute In ASP.NET MVC
Answer : It is not easy to achieve this with an if condition inside the helper method because all the below markups will render a disabled chechbox. <input type="checkbox" disabled> <input type="checkbox" disabled="disabled"> <input type="checkbox" disabled="false"> <input type="checkbox" disabled="no"> <input type="checkbox" disabled="enabled"> This should work in the razor. Simple If condition and rendering what you want. @if(item.Selected) { @Html.CheckBoxFor(modelItem => item.Selected) } else { @Html.CheckBoxFor(modelItem => item.Selected, new { @disabled = "disabled"}) } You may consider writing a custom html helper which renders the proper markup for this. This won't work because <input disabled="anything" /> will result in a disabled control. You need to only have a @disabled property when it should be d...