How to get the "name" of a route when in a route controller

I am using routing in asp.net to get nice urls

When I define routes in global.asax, I create two different 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) can one determine from within a controller what is the "key" value that directs the user to that controller? As an alternative to the misuse pattern - it would be easy to subclass the Controller (again) to distinguish between the two and keep the common code if that is a more suitable solution.

0


a source to share


1 answer


There is always a routing debugger http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx . Very helpful from time to time.



0


a source







All Articles