示例 - 单击按钮
$('#btn').click(function () {
var flag = false;
var b;
$.ajax({
type: 'GET',
url: '/Test/PV1/' + $('#Elements').val(),
data: null,
success: function (data) {
alert(data.pageID);
}
});
return false;
});
在控制器中
public ActionResult PV1(int id)
{
//-- here i need to make a call to the partial view as well as return the pageID to the main view
}
是否可以在从主视图调用部分视图的同时将 JSON (ID) 返回到主视图