ASP.NET MVC MapRoute problem

Posted by MaxFX on Stack Overflow See other posts from Stack Overflow or by MaxFX
Published on 2010-05-09T00:19:19Z Indexed on 2010/05/09 0:28 UTC
Read the original article Hit count: 510

Filed under:
|

Default ASP.NET MVC project has one MapRoute like

routes.MapRoute(
            "Default",
            "{controller}/",
            new { controller = "Home", action = "Index" }
            );

And urls like these are equivalent: www.mysite.com, w*ww.mysite.com/home*, www.mysite.com/home/index

But if I trying to use a MapRoute like

            routes.MapRoute(
            "Sitemap",
            "{contoller}/{action}",
            new { controller = "Sitemap", action = "ShortMap" }
        );

and test url www.mysite.com/sitemap I recieve error 404 but I'm expecting that it's work like www.mysite.com/sitemap/shortmap

How to write this MapRoute correctly?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about maproute