一:Jquery如何使用JSON传递多个参数给Controller中Action方法
案例一:ajax传递一个基本参数给action
<script type="text/javascript">
$(document).ready(function () {
var postData = { userId: 4 };
var
url =
"@Url.Action("GetUserName")";
$.ajax({
async:
false,
type:
"POST",
url:
url,
data:
postData,
cache:
false,
global:
false,
dataType:
‘json‘,
success: function (data)
{
}
});
});
</script>
后台Controller:
public
ActionResult GetUserName(int
userId)
{
JsonResult jt = Json(new { success = true
});
jt.ContentType =
"text/html";
return jt;
}
二:Jquery如何处理Controller返回的List集合对象
三:相关总结