【发布时间】:2010-12-26 03:30:42
【问题描述】:
我在 Asp.NET 中编写了以下代码,我正在尝试将其转换为 MVC,但不确定如何在 Action 中执行此操作
HttpContext context;
context.Response.ContentType = "application/pdf";
context.Response.AppendHeader("Content-Disposition", String.Format("attachment;filename={0}", filename));
context.Response.WriteFile(filename);
context.Response.Flush();
context.Response.SuppressContent = true;
【问题讨论】:
标签: asp.net-mvc pdf-generation