开发者

ASP.Net MVC - return view and launch document at same time

开发者 https://www.devze.com 2022-12-18 14:35 出处:网络
I have a ASP.Net MVC form that upon submit I nee开发者_开发问答d a couple of things to happen.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消