I am using jquery post method for executing a server side action
the method is :
function redirectToDraft() {
updateInboxGridAndCloseApproveDialog();
$.post('/Personnel/AgendaApproveDocument');
}
it will post to this action and then in the action i need to redirect to another action on the other controller like this :
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
}));
}
it works and redirect to the method:
public ActionResult RelatedDocumentDraft(int?activityId, string factory, string title)
{
return View("~/Views/RegisterLetter/NewDraft.aspx");
}
my problem is that it doesnt return to the view “NewDraft”
is there any thing wrong?
In your AJAX call you haven’t subscribed to the success callback, so nothing will happen. If you wanted to handle the results of an AJAX call, that’s what you should do: