How 404 error asp.net mvc 2 IIS 7?

Posted by Dmitriy on Stack Overflow See other posts from Stack Overflow or by Dmitriy
Published on 2010-06-08T14:12:20Z Indexed on 2010/06/08 14:22 UTC
Read the original article Hit count: 275

Filed under:
|
|

Hello!

I tried to catch 404 errors like this... But

  1. when i try to load http://localhost:11415/wfwe/wefwe/ - all good work.
  2. When i try to load http://localhost:11415/order/ - fail (with error The RouteData must contain an item named 'action' with a non-empty string value.)
  3. When i try to load http://localhost:11415/Images/ - fail with error File does not exist

My routes:

      routes.Add("Order", new LowercaseRoute("Order/{action}/{id}",
                                               new RouteValueDictionary(
                                                   new
                                                       {
                                                           controller = "Order",
                                                           action = "",
                                                           id = UrlParameter.Optional
                                                       }),
                                               new MvcRouteHandler()));
routes.Add("NotFound", new LowercaseRoute("{*url}", new RouteValueDictionary(
                                                 new
                                                 {
                                                     controller = "Pages",
                                                     action = "Http404",
                                                 }),
                                             new MvcRouteHandler()));

Why route NotFound - don't catch all 404 error. And When i try to upload to my hosting and try 404 i get this error (NotFound route not work at all) 404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

I work with this all day, but nothig... please help me

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mvc