視圖:
<ul id="ulcomment"></ul>
<table>
<tr><td><a href="" id="p1">1</a></td></tr>
</table>
<script type="text/javascript">
$("#p1").click(function (e) {
$.post("/Paging/Ajax_paging", {action: "getCount", pagenum: "1" }, function (data, static) {
........
});
});
</script>
? $.post("/Paging/Ajax_paging", { "action": "getCount", "pagenum": "1" }xxxxxx
? ajax提交到這個url?對應(yīng)的控制器
??
public int Ajax_paging(string action, string pagenum)
{
string action_sp = Request["action"];
if (action_sp == "getCount")
{
.........................
}
else
{
string pagenum_sp = Request["pagenum"];
..............................
}
}
?
獲取不到 ?路勁沒有錯誤我調(diào)試進(jìn)去了 請問這個ajax請求提交參數(shù) 控制器獲取有問題嗎?錯在哪里呢?要怎么修改呢?
5 回答

吃雞游戲
TA貢獻(xiàn)1829條經(jīng)驗 獲得超7個贊
你這種提交方式提交的json是在request的body里的,不是參數(shù)的形式,把post的目標(biāo)地址改成這樣就可以了:
/Paging/Ajax_paging?action=getCount&pagenum=1
- 5 回答
- 0 關(guān)注
- 376 瀏覽
添加回答
舉報
0/150
提交
取消