Reputation: 59416
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?
Upvotes: 5
Views: 2120
Reputation: 2673
You can use the HttpRequestWrapper
instance which will convert from HttpRequest
to HttpRequestBase.
var httpRequestBase = new HttpRequestWrapper(HttpRequest);
Upvotes: 10