I'm porting a simple application from ASP.NET MVC to WebForms and I am supposed to pass a instance of HttpRequestBase
to a method, but I'm only finding the instance of HttpRequest
, which is exposed as the property Request
from the Page
class.
How can I get an instance of HttpRequestBase
from a System.Web.UI.Page
? Is that even possible?
You can use the HttpRequestWrapper
instance which will convert from HttpRequest
to HttpRequestBase.
var httpRequestBase = new HttpRequestWrapper(HttpRequest);
MSDN Reference Manual
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