views:

222

answers:

1

I'm using routing in asp.net to get nice URLs

When I define routes in global.asax I create two distinct routes that use the same controller (c#):

        // Setup code for route a...
        routes.Add("routeb", routea);

        // Setup code for route b...
        routes.Add("routeb", routeb);

(How) is it possible to determine from within the controller what the "key" value is that directed the user to this controller? Alternatively is the pattern of use wrong - it would be straightforward to subclass the Controller (again) to distinguish between the two and retain common code if that is a more appropriate solution.

A: 

There is always the Routing Debugger http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx . Very helpful at times.

ondesertverge