ASP.Net MVC - return view and launch document at same time
I have a ASP.Net MVC form that upon submit I nee开发者_开发问答d 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
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.
精彩评论