我使用jQuery post方法用于执行服务器端操作重定向到ASP.NET MVC行动,方法不会返回视图
方法是:
function redirectToDraft() {
updateInboxGridAndCloseApproveDialog();
$.post('/Personnel/AgendaApproveDocument');
}
将张贴到这一行动然后在行动,我需要重定向到另一个动作的另一个控制器这样的:
public ActionResult AgendaApproveDocument(int? id){
return RedirectToAction("RelatedDocumentDraft", new RouteValueDictionary(
new
{
controller = "RegisterLetter",
action = "RelatedDocumentDraft",
title = relatedDoc.Name,
factory = relatedDoc.DocumentFactory,
activityId = action.WorkItem.Id
}));
}
它的工作原理,并重定向到方法:
public ActionResult RelatedDocumentDraft(int?activityId, string factory, string title)
{
return View("~/Views/RegisterLetter/NewDraft.aspx");
}
我的问题是,它不返回到视图“NewDraft”
有什么东西错了吗?
您是否尝试过调试以查看您是否真的可以在该位置查看? – Rob
那么它被重新定向了哪个页面?或者你得到了什么回应? – Lamps