ASP.NET Core 2 Equivalent of Request.Servervariables
Asked Answered
M

0

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?

Mcdaniels answered 20/11, 2017 at 14:45 Comment(2)
Ever find anything out on this? I'm having same problem accessing handful of different 'server variables' I used to use in asp.net.Rudd
Does this still work in core: #16331258Ekaterina

© 2022 - 2024 — McMap. All rights reserved.