When i create a Html.CheckBox() in Asp.net MVC 2 i wonder there is a hidden field with that checkbox as well when i view its html, from where that hidden field is coming and what its purpose is?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From a comment in the ASP.NET MVC source code:
For example if the user doesn’t check the value there’s nothing sent to the server so if you are binding to some view model in your post action there won’t be any value. The hidden field sends the value of
false.