Skip to content

Instantly share code, notes, and snippets.

@stevejay
Created May 5, 2014 21:15
Show Gist options
  • Save stevejay/d596c838af17a2292cb3 to your computer and use it in GitHub Desktop.
Save stevejay/d596c838af17a2292cb3 to your computer and use it in GitHub Desktop.
var path = HttpContext.Current.Request.Path;
HttpContext.Current.RewritePath("~/Error/ManualErrors");
HttpContext.Current.Session["statusCode"] = statusCode;
IHttpHandler handler = new MvcHttpHandler();
handler.ProcessRequest(HttpContext.Current);
HttpContext.Current.RewritePath(path);
HttpContext.Current.Server.ClearError();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment