这是出现这种情况的人谁通过AJAX加载的局部视图一个非常常见的错误,这种观点与DataAnnotation验证的模型。当u加载查看验证停止工作。
如何解决呢?
解决方案 $。获得(URL,函数()
{
$ .validator.unobtrusive.parse(#形式-ID);
});
That's a very common bug that happens to people who load a partial view via ajax and that view has a model with DataAnnotation validators. When u load the View the validation stop working.
How to fix that?
解决方案$.get("url", function()
{
$.validator.unobtrusive.parse("#form-id");
});