var dataObj = { "cateId": 7, "pageCount":10, "pageNum":0, "S_CaoZuoR":"sclgs", "B_IsShow":1 }; postFormData(dataObj);
function postFormData(dataObj) {
var formData = new FormData();
for (var key in dataObj) {
formData.append(key, dataObj[key]);
}
$.ajax({
type: "POST",
url: url,
cache: false,
processData: false,
contentType: false,
data: formData,
success: function (data) {
return data;
},
error: function (xhr, state, err) {
alert(JSON.stringify(err));
}
});
}
[HttpPost] [Route("content/SelectPageByAdmin3")] public IEnumerable<PW_Content> SelectPageByAdmin3() { int cateId = Convert.ToInt32(HttpContext.Current.Request.Params["cateId"]); int pageCount = Convert.ToInt32(HttpContext.Current.Request.Params["pageCount"]); int pageNum = Convert.ToInt32(HttpContext.Current.Request.Params["pageNum"]); string S_CaoZuoR = HttpContext.Current.Request.Params["S_CaoZuoR"].ToString(); int B_IsShow = Convert.ToInt32(HttpContext.Current.Request.Params["B_IsShow"].ToString()); return Service.SelectPageByAdmin2(cateId, pageCount, pageNum, S_CaoZuoR, B_IsShow); }