6

This is a little annoying thing. Definitely not a show stopper. What is the equivalent of Request.ServerVariables?
Specifically, I would like to know how I get the current URL?

I have previously done this by getting Request.ServerVariables["script_name"]. I hate hard-coding text into a program, and I am finding that I would need to get the URL of the current page. I'd like to get the current URL of the running razor page, but I can't figure out why. Does anyone else know how to get the current URL in the current page?

shA.t
  • 16,580
  • 5
  • 54
  • 111
Wallace B. McClure
  • 1,165
  • 1
  • 15
  • 31
  • Ever find anything out on this? I'm having same problem accessing handful of different 'server variables' I used to use in asp.net. – Terry Jul 10 '18 at 19:39
  • Does this still work in core: https://stackoverflow.com/questions/16330758/asp-net-web-api-how-do-you-read-server-variables-in-a-web-api-controller – No Refunds No Returns Nov 27 '18 at 19:31

0 Answers0