Questions tagged «actionmethod»

4
如何将JSON作为MVC 5操作方法参数接收
我一直在尝试整个下午在网络上爬行,试图在动作控制器中接收JSON对象。 什么是正确的或更简单的方法? 我尝试了以下方法:1: //Post/ Roles/AddUser [HttpPost] public ActionResult AddUser(String model) { if(model != null) { return Json("Success"); }else { return Json("An Error Has occoured"); } } 这给了我输入一个空值。 2: //Post/ Roles/AddUser [HttpPost] public ActionResult AddUser(IDictionary<string, object> model) { if(model != null) { return Json("Success"); }else { return Json("An Error Has occoured"); …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.