MVC Remote Attribute Additional Fields

随声附和 提交于 2019-12-06 16:47:54

What I ended up having to do was add the hidden field twice. I already had a generic setup for multiple actions in the controller expecting the name as was. So by adding the hidden field with the naming convention that the jquery validation library expected, it was then transmitted as part of the query string. The naming convention is Model_Field for the id attribute and Model.Field for the name attribute.

I then used the bind parameter attribute with the prefix as follows:

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