在MVC应用程序文件下载
问题描述:
我如何设置它,这样当单击视图链接,它会提示用户下载文件。
How do I set it so that when a link is clicked in a view, it prompts the user to download a file.
答
您可以只返回一个FileResultType。 http://msdn.microsoft.com/en-us /library/system.web.mvc.fileresult.aspx
You can just return a FileResultType. http://msdn.microsoft.com/en-us/library/system.web.mvc.fileresult.aspx