0

I have written code to get the path to the controller. Here it is:

 string link = Url.Action(
            (string)RouteData.Values["Login"],
            (string)RouteData.Values["Clients"],
            Request.Url.Scheme);

But it returns :/Clients/Sending?Length=4

I need to return the full path

For example: http://localhost:51542/Clients/Sending?Length=4

How I can do this?

Peter Bons
  • 26,826
  • 4
  • 50
  • 74
S.E
  • 49
  • 1
  • 10
  • Get the host name using `System.Web.HttpContext.Current.Request.Url.Host` and prepend it to the beginning. – Luke May 31 '17 at 08:17

1 Answers1

2

The AbsoluteUri property includes the entire URI stored in the Uri instance, including all fragments and query strings.

Request.Url.AbsoluteUri

you can use like this

Karan Singh
  • 876
  • 1
  • 6
  • 12