Search code examples
c#asp.net-mvcmodel-view-controllerframeworks

HttpContext is not rexognized even after using System.web( It is used in the controller)


enter image description here

An object reference is required for the non-static field, method, or property 'Controller.HttpContext',


Solution

  • You are not in the controller directly, to access HttpContext here use property of filterContext:

    filterContext.HttpContext