在我的控制器中,我有以下代码:
public JsonResult GetInfo(string id)
在我的JS中
$.ajax({
contentType: 'application/json, charset=utf-8',
type: "POST",
url: "/Incidents/GetInfo",
data: { id: "777" },
cache: false,
dataType: "json",
success: function (response) {
//etc....
当使用jQuery的ajax方法时,如果发生错误则会触发代理(delegate)函数。
data: { "777" },
没有出现错误,但是值没有被传递。这应该很简单,但我一直在苦思冥想。也许我不能将字符串传递给控制器的操作?
我在这里做错了什么?
JsonValueProviderFactory
。 - counsellorben