I am developing a full-web application and I am using the ASP.NET MVC 3 framework. I am implementing a subclass of ActionFilterAttribute.
I am overriding the OnActionExecuting method. If an exception is caught in OnActionExecuting method I want to redirect the client browser. The redirection URL targets an action method in one of my controllers. I want to pass data from the Exception object into the redirection URL.
Is there a way to build a URL including the Exception object and then passing the URL into the RedirectResult constructor?
No. You can pass only query string parameters like for example:
and in the target action you will be able to fetch the exception text parameter: