0

I want to get the complete URL entered by the user in the browser obviously with the correct domain name. For example, if my domain is www.TestDomain.com and the user enters the correct domain but with some extra parameters like www.TestDomain.com/Test/1124/tres. This new URL causes 404 error so i want to get this URL in the controller action method.

Thanks & Regards

nado1122
  • 19
  • 1
  • 3
  • Does this answer your question? https://stackoverflow.com/a/46311534/6621862 – Luke Jan 27 '23 at 19:28
  • @Luke its only returning the controller and the action method name not the complete URL in the browser. – nado1122 Jan 27 '23 at 20:06
  • 1
    Try this `var location = new Uri($"{Request.Scheme}://{Request.Host}{Request.Path}{Request.QueryString}"); var url = location.AbsoluteUri;` – Xiaotian Yang Jan 28 '23 at 08:56

0 Answers0