0

Does anyone know what the best way would be to deal with error pages using ASP.NET (not MVC) Routing?

I have routing set up and working well, however if I visit a page which does not exist i get the standard 404 error page.

I would like to know if there is a way to catch these errors using Routing using something like the following, obviously 404 would be replaced with the code given.

RouteTable.Routes.MapPageRoute("errors", "{*url}", "~/error.aspx");

Also using the above code messes up my existing routing, so I assume the {*url} catches all URL's.

Thanks in advance.

thatuxguy
  • 2,418
  • 7
  • 30
  • 51
  • 2
    Your route definition seems ok. Note that it must be LAST in your route definitions : in MVC, this would lead to http://stackoverflow.com/a/14586192/1236044 – jbl Apr 16 '13 at 14:08
  • I ended up using httpErrors which got the error pages working. – thatuxguy Apr 24 '13 at 13:16
  • Used similar to this post to get working. http://stackoverflow.com/questions/7729261/example-of-configuration-for-httperrors – thatuxguy Jan 26 '15 at 14:09

0 Answers0