I'm calling a third-party library that takes a System.Web.HttpResponse
. I see I have a HttpResponseBase
, but not HttpResponse
like in web forms.
Is there a way to get the HttpResponse
? Using MVC 3
.
[Edit] : I'm trying to do this in a controller method. Also corrected casing.
If you need to interact with systems which take the non-mockable types, you can get access to the current HttpContext via the static property System.Web.HttpContext.Current. The HttpResponse is just hanging off of there via the Response property.
In mvc application you can use HttpContext.ApplicationInstance.Response
.This helped me for getting the HttpResponse
in MVC Application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With