views:

60

answers:

1

I have a ASP.Net MVC form that upon submit I need a couple of things to happen.

  • Firstly I need to generate a pdf report and launch it
  • Secondly I need to return to the main index page

Currently I can do the first by returning a filestream from my action OR the second by returning a view but I can't figure out how to do both

Can anyone point me in the right direction?

Thanks

+2  A: 

Why don't you return the main index page first, and in the page have it make an ajax call to a separate action which returns the pdf file?

You would just need to make sure the ajax call opens up the response in a separate window/tab.

Joseph
Unfortunately not allowed to rely on javascript so everything must be from post
Mark
I went with your solution in the end and added a link also in case no javascript. Thanks
Mark
How do you do the AJAX call that return the PDF?
VinnyG