code_junkie

Custom Errors for “App” folders? (ASP.NET)

Nov 12th, 2011
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. void Application_Error(object sender, EventArgs e)
  2. {
  3. //uncomment this to narrow down 'helpful' microsoft messages
  4. //HttpRequest request = ((HttpApplication)sender).Context.Request;
  5.  
  6.  
  7. Exception ex = Server.GetLastError();
  8. //ErrorManager is a custom error handling module
  9. ErrorManager.ProcessError(ex);
  10. Response.Redirect("~/error.aspx?error=" + HttpUtility.UrlEncode(ex.Message), true);
  11. }
Add Comment
Please, Sign In to add comment