Tuesday, January 18, 2011

The face behind check box helper (Html.CheckBox()) renders two input controls in ASP.NET MVC

                       When you are working with ASP.NET MVC built-in HTML helper the check box helper(Html.CheckBox()) renders two input controls.  First, it renders a check box control as you’d expect, and then it renders a hidden input control of the same name.
                  This is to work around the fact that when check boxes are deselected, browsers don’t submit any value for them. Having the hidden input control means the MVC Framework will receive the hidden field’s value (i.e., false) when the check box is
unchecked.