Asp.NetMVC的ContentResult返回字符串,jquery.post的回调函数不接受,为什么
Asp.NetMVC的ContentResult返回字符串,jquery.post的回调函数不接受,为什么?
因为你返回的是字符串"success",对于$.post来说,数据类型应该是html。但是你定的$.post数据类型是json。
要么把$.post最后的"json"去掉
要么return Json(new {result = "success"}),然后在$.post里面用response.result 获取返回值。