As I started ASP.Net MVC developing, it was a little bit confused for me how to get a Checbox value (true or false) from the View to the Controller.
To include a Checkbox into a View you must use the HtmlHelper.
<%=Html.CheckBox("isActive",true) %><label for="isActive">is active user</label>
By using this pattern, you can access the Boolean value within the controller with the following method head
public ActionResult Insert( string firstName, string lastName, bool? isActive)
{
// ...
}
Important is that you make a nullable boolean here for accessing the isActive Property.
For me as ASP.Net developer it was new to use the HTML Helper class, the first three times I tried to use the common html input tag for rendering a checkbox and run every time into the same error cause the MVC Framework doesn't pass the value of the checkbox correctly.
Until now HTML class seams to be the best way to realize this.