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 hardcoding 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?

TIA.

Wallace B. McClure
  • 937
  • 1
  • 11
  • 25
  • 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