MVC Html.CheckBox and form submit issue

后端 未结 4 1563
醉酒成梦
醉酒成梦 2020-12-17 16:11

Crazy issue with submitting of values in Html.Checkbox in ASP.NET MVC RC

Some of the values are just not come to Request.Params

At my form I have this line i

4条回答
  •  鱼传尺愫
    2020-12-17 16:40

    This is actually the way it should work according to specifications.

    It has nothing to do with ASP.NET MVC, but when a check box is left unchecked it is not included in the POST collection.

    You get two values because you have both a checkbox and an input with the same name (and the ones you have two values for are most likely the ones with checkboxes checked).

    Edit: specifications from W3C

提交回复
热议问题