如何显示
JSON返回的ModelState错误?
我想做这样的事情:
if (!Validatelogon(Name,currentPassword)) { ModelState.AddModelError("_FORM","Username or password is incorrect."); //Return a json object to the javascript return Json(new { ModelState }); }
在查看ModelState错误并显示它们时,我的代码必须是什么?
我的实际代码在视图中读取JSON值如下:
function createCategoryComplete(e) { var obj = e.get_object(); alert(obj.Values); }
解决方法
原文地址:https://www.jb51.cc/aspnet/249944.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。