我在我的控制器之一中使用了下面的代码;asp.net mvc ajax post - redirecttoaction不起作用
if (Request.IsAjaxRequest()) {
return RedirectToAction("PreviewAndSendEmail");
}
我调试它,它来到返回线,但重定向没有发生。是否有可能在Ajax.BeginForm中做到这一点?这里是剃刀代码;
using(Ajax.BeginForm(new AjaxOptions { LoadingElementId = "loading" })) {
<b>Choose E-mail Template : </b>@Html.DropDownList("emailtemps")<br /><br />
<input type="submit" value="Preview & Send" />
<span id="loading" style="display: none;">
<img title="loading..." alt="load" src="@Url.Content("~/Content/App_Icons/gifs/loading.gif")"
</span>
}
可能重复http://stackoverflow.com/questions/3534956/how-can-i-redirecttoaction-within-ajax-callback – 2011-02-18 13:36:50