【发布时间】:2014-03-25 12:55:03
【问题描述】:
所以我使用这个来调用我的操作结果方法:
var url= "/Example/Controler/1/Action";
$("<form action='"+url+"'></form>").submit();
但是action Method没有被调用... 这个我也试过了
$.post(url, function (data) {});
这行得通,我们调用了控制器,但是页面没有刷新...
我的操作方法如下所示:
public ActionResult DoStuff(int Id)
{
.....
return RedirectToAction("index", new { Id });
}
【问题讨论】:
-
您真的在提交数据吗? (
<form>是必需的吗?)另外,你的行为是否偶然被HttpPost修饰了? -
在$.post()方法成功函数中,需要更新页面内容
-
@Brad Christie nope no httppost
标签: javascript jquery asp.net-mvc model-view-controller