Reputation: 71
I'm trying to set a variable to the current URL using:
Dim url As String = HttpContext.Current.Request.url.AbsoluteUri
Which is returning:
This seems to be the file name followed by the web function name.
What it's supposed to return/what it's displaying in IE is:
Why is this?
Upvotes: 0
Views: 657
Reputation: 39339
You are apparently in a WebRequest, so the current request is the request for that method. However, it is sent from some page, so possibly a "referrer" is set with the URL you are looking for.
See Getting the HTTP Referrer in ASP.NET for more details on how to get it. Basically: use Request.UrlReferrer
Upvotes: 1