Reputation: 183
How can I add Css style for checkBoxFor on MVC?
This is My View
@Html.CheckBoxFor(m =>
Model.CategoryList.Categories[i].IsCheck)
@Model.CategoryList.Categories[i].SelectedCategoryName;
@Html.HiddenFor(m =>
Model.CategoryList.Categories[i].SelectedCategoryID);
@Html.HiddenFor(m => Model.CategoryList.Categories[i].SelectedCategoryName);
Upvotes: 2
Views: 7803
Reputation: 125
@Html.CheckBoxFor(m => Model.CategoryList.Categories[i].IsCheck, new { @class = "myclass" })
Or you can also add inline CSS but i recommend using the first approach.
@Html.CheckBoxFor(m => Model.CategoryList.Categories[i].IsCheck, new { style="width:100px;height:25px" })
Upvotes: 5