1
votes

I use routing in my web forms. for example:

routes.MapPageRoute("Home", "HomePage", "~/Default.aspx");

and I redirect to page with

Response.RedirectToRoute("Home");

now Is there a function (or solution) in asp.net that will give it route name [Home] (or URL parameters [HomePage]) and return original address (Default.aspx)?

Thanks a lot.

1

1 Answers

0
votes

You could just get the full URL:

HttpContext.Current.Request.Url.AbsoluteUri;

and see other .Url properties

see this answer for more examples: How to get the URL of the current page in C#