I use the following HTML helper to generate check box:
<%= Html.CheckBox("DeluxeFeature")%>
Now I want to access the value of this checkbox in my controller. How should I do this? I am not going to use the method parameter name, for the reason that there are a lot of checkboxes and putting all of them in the parameter will clutter the method.
I try to use
Request.Form["DeluxeFeature"]
But the behavior is very weird; if the checkbox is not ticked, then the Request.Form["DeluxeFeature"]
returns "false
", which is expected. But if the checkbox is ticked, then it retruns "true, false
".
Very weird, isn't it?