如何返回ASP.NET MVC一个FileResult和RedirectToAction [英] How to return a FileResult AND RedirectToAction in ASP.NET MVC
本文介绍了如何返回ASP.NET MVC一个FileResult和RedirectToAction的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个返回通过查看(...)一FileResult一个Action
。这个效果很好。
I have an Action that returns a FileResult via View(...)
. This works well.
我非常希望能够以某种方式返回一个文件,然后重定向到另一个动作(或以某种方式做同时使用)。
Ideally I would like to be able to somehow return a file and then redirect to another action (or somehow do both simultaneously).
这可能吗?
推荐答案
它可以通过在客户端上的JavaScript code这运行下载开始后完成的,你可以看到在很多网站的模式,最显着的微软下载中心
It could be done by a javascript code in client side which run after download started, you can see the pattern in many website, most notably Microsoft download center.
这篇关于如何返回ASP.NET MVC一个FileResult和RedirectToAction的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文