How to modify MapRoute (add new dir)

Posted by LuRsT on Stack Overflow See other posts from Stack Overflow or by LuRsT
Published on 2010-03-26T10:09:46Z Indexed on 2010/03/26 10:13 UTC
Read the original article Hit count: 409

Filed under:
|
|

How can I change my map route so I can have another dir, and not just the controllers and actions.

What I want is to have another directory before the controller so that way I can separate controller per "module"

        routes.MapRoute(
            "Default",                                       // Route name
            "{module}/{controller}/{action}/{id}",           // URL with params
            new { module = "module", controller = "controller", action = "Index", id = ""}

This is what I want, but the code doesn't work. What more do I need to change to change the MapRoute?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about ASP.NET