03 June 2016

Url.Action vs Url.RouteUrl

Url.RouteUrl allows you to specify a particular route by name. This will force the usage of that route.

If you have multiple routes with similar parameters the Action method may pick a wrong one - it works based on the order of route definitions. This may take place when your routes have optional parameters.

No comments: