How can I access a query like HttpRequestBase in ASP.NET WebForms?

I am porting a simple application from ASP.NET MVC to WebForms, and I have to pass the HttpRequestBase instance to the method, but I only find the HttpRequest instance that displays as the Request property from the Page class.

How can I get an instance of HttpRequestBase from System.Web.UI.Page ? Is it possible?

+4
source share
1 answer

You can use an instance of HttpRequestWrapper that will convert from HttpRequest to HttpRequestBase.

 var httpRequestBase = new HttpRequestWrapper(HttpRequest); 

MSDN Reference Guide

+8
source

Source: https://habr.com/ru/post/1493921/


All Articles