Reputation: 475
In my mvc3 POST ActionResult method, I have a portion of code like this:
if (button == "Save as Pdf")
{
RedirectToAction("getPdf", "Pdf", resultObtained);
}
when the user clicked on the button, it redirect the user to getPdf action in PdfController while passing the object resultObtained as well to get the PDF file downloaded via browser but the RedirectToAction itself is not working.
Thanks.
Upvotes: 5
Views: 1723
Reputation: 9806
Try this:
if (button == "Save as Pdf")
{
return RedirectToAction("getPdf", "Pdf", resultObtained);
}
Upvotes: 6