0
单击超链接时,我想在应用业务逻辑后导航到页面。目前,mvc动作中的“返回重定向(Url)”不会导航到该页面。MVC重定向不会导航到页面
$("a").bind("click", function (e) {
e.preventDefault();
gotoUrl($, this.href);
});
gotoUrl: function ($, href) {
$.ajax({
type: "POST",
url: 'mycontroller/myaction',
data: { url: href },
dataType: 'json',
cache: false
success: function (data) { }
});
}
//mycontroller
[HttpPost]
public ActionResult myaction(string url)
{
//Some business logic here to update url
return Redirect(url);
}