asp.net - 如何在 ASP.NET MVC 中获取对 HttpResponse 的引用?

标签 asp.net asp.net-mvc asp.net-mvc-3 asp.net-mvc-2 asp.net-mvc-4

我正在调用一个接受 System.Web.HttpResponse 的第三方库。 .我看到我有一个 HttpResponseBase ,但不是 HttpResponse就像在网络表单中一样。

有没有办法获得HttpResponse ?使用 MVC 3 .

[编辑] :
我正在尝试在 Controller 方法中执行此操作。还修正了 shell 。

最佳答案

如果您需要与采用不可模拟类型的系统进行交互,您可以通过静态属性 访问当前的 HttpContext。 System.Web.HttpContext.Current . HttpResponse 只是通过 Response 属性卡在那里。

关于asp.net - 如何在 ASP.NET MVC 中获取对 HttpResponse 的引用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5313495/

相关文章:

javascript - Razor View 模型绑定(bind)使用javascript函数

c# - 使用 Razor 在同一行上循环html标签

c# - 如何让用户登录系统并仅在用户单击注销按钮后注销?

c# - 多个提交按钮不会在 aspx 上回发 - 只有最后一个按钮

jquery - asp.net mvc4 jquery 不工作

c# - ef6 include() 用于具有必需属性的可空属性

asp.net-mvc - 基于@RenderBody Controller 的动态内容?

c# - updatepanel 更新整个页面而不仅仅是内容模板

asp.net - 控制哪些 WebMethod 在 WebService 中对外公开

asp.net-mvc - 成员(member)提供商中的 GetAllUsers 在哪里?