You can extract this information from the routes:
var controller = RouteData.Values["controller"]; var action = RouteData.Values["action"]; var action = RouteData.Values["area"];
As for the query string, you can pull it out of the query:
var queryString = Request.Url.Query;
UPDATE:
If the URL comes from the database:
var uri = new Uri(someStringThatRepresentsTheUrlAndComesFromADb); var queryString = uri.Query;
Darin Dimitrov
source share