ASP.NET MVC: how to parse a URL string to get RouteData

Is there any way to get RouteData from url string?

I have a login form with returlUrl as a query string parameter. My routes are defined as:{languageCode}/{controller}/{action}

In the action method, LogIn(string returlUrl)returlUrl is something like "ru / home / contacts", etc. I need to change the language of the Part, I do not want to use string.Replace, as the routes may change in the future.

Thank.

+5
source share
2 answers

This forum may be useful: http://forums.asp.net/t/1281667.aspx

, . , RouteTable.Routes.GetRouteData Mocking HttpContextBase URL.

+1

, , , - , Google, , . SO, , , , .

RouteData URL

+4

All Articles