Does anyone know how to get the current RequestContext from the Application_Error event in global.asax?? My problem is that i need to do a redirect, and thereby need to have the url generated using UrlHelper – which takes the aformentioned RequestContext.
Accessing RequestContext from global.asax
model-view-controller
Best Answer
While there is no direct way of accessing the RequestContext, you can create one yourself:
So the UrlHelper can be constructed via:
Not pretty, but it gets the job done.