My methods take HttpRequestBase as arguements, and I am finding it strange as to why the Actions in Controllers have access to HttpRequestBase but the view page’s have HttpRequest.
Is there a reason for this or just something that was not thought through?
View pages have access to the MVC HttpContext through
ViewContext.HttpContext, which is anHttpContextBase.The seemingly dual access is just due to the way ASP.Net works. When you look at
Request.HttpContext, this is the ASP.Net pipeline’s injection of the originalHttpContext. This is accessible in any HttpHandler, whether it’s an MVC controller or view, or a WebForms page or ashx.