Web
Analytics
checkboxfor in mvc 5 example | Entity framework | | Angular | ASP.NET Tutorials

For Consultation : +91 9887575540

Stay Connected :

Example of Checkboxfor helper with entity framework

Html helper class have two methods to generate checkboxes(<input type=‘checkbox’>

Checkbox() –Loosely Typed

          MvcHtmlString CheckBox(string name, bool isChecked, object     htmlAttributes)

Checkboxfor() –Strongly Typed

(It generates <input type=”checkbox”> element for the model property specified using a lambda expression.)

MvcHtmlString CheckBoxFor(<Expression<Func<TModel,TValue>> expression, object htmlAttributes)

It generates <input type=‘checkbox’ /> and <input type=‘hidden’ value=false or true>




 

Download Source Code

 

Part -1

Part -2