Why does ASP.NET MVC Html.CheckBox output two INPUTs with the same name?

It forces the field to be included if it’s unchecked. If you uncheck a check box it doesn’t get sent as part of the page – they are only sent if they’re checked, and then there’s a value of true. The hidden field ensures that false will be send if the check box is unchecked, as the hidden field is always sent.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)