Why doesn't request.rawurl include the http://localhost part?
asp.net, httprequest
Solution
According to the documentation:
The raw URL is defined as the part of the URL following the domain information. In the URL string http://www.contoso.com/articles/recent.aspx, the raw URL is /articles/recent.aspx. The raw URL includes the query string, if present.
You can use `Request.Url.AbsoluteUri` to get the entire thing.
Problem
When I call Request.RawUrl I am not getting the domain name (at least in development). For example, if my url locally is: http://localhost:2343/some/thing The call to Request.RawUrl is giving me back: /some/thing I recall it returns everything, is this the behaviour b/c it is local dev? Update I am also using Url Re-Writing so things like Request.Url.AbsoluteUri return back the internal url, not the re-written url that i need to get. is javascript the only way then? Or I maybe I can use Request.RawUrl for the url part, and then just get the domain name part somehow? (sometimes it has a port too...)