Reputation: 1302
I'm wondering if there is a way to declare routes in MVC3 so that the route "zone1/{controller}/{action}" would direct to {controller}.zone1{action}
method and "zone2/{controller}/{action}" would direct to {controller}.zone2{action}
method, for example. So that's basically transforming the target action name based on the route.
Thanks
Upvotes: 0
Views: 118
Reputation: 30152
Check out The Attribute Routing project. You can specify on your methods the routes which I feel is a bit easier to read. Here's a decent blurb on it: http://gregorsuttie.com/2012/01/12/attributerouting-for-mvc/
You could also write your own custom route handler but I don't believe you can do what you want without some custom code. I could be wrong here though. The attribute routing project should work just fine for what you want however.
Upvotes: 1