Unobtrusive validation not working after adding checkboxes to the form in mvc 4

天涯浪子 提交于 2019-12-01 22:45:59
markpsmith

I had exactly this problem & posted a question here. Currently I don't have a solution to the problem, but I did find a workaround. Instead of using Html.CheckBoxFor I used Html.CheckBox like so:

@Html.CheckBox("Employee.Active")

I gave it the same name as the CheckBoxFor that was created by the razor view. This is now working as I expected but I consider it a workaround rather that a solution, and I have no idea what's actually causing the problem!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!