tags:

views:

36

answers:

2

How to get url from RouteTable.Routes collection by key?

A: 

untested, but seen here link

RouteTable.Items[ "myRouteName" ]

to get the Url i would try this

( (Route) RouteTable.Items[ "myRouteName" ] ).Url

Attention: The items collection can return null if a route with the specified name don't exists.

Viper
A: 

Try this

RouteCollection routes = RouteTable.Routes;
RouteBase route = routes["key"];

RouteTable.Routes["key"]

Mouhannad