how can I get only the domain, for example:
The url: http://localhost:11093/SiteA/Admin/Default.aspx
Then, I want to get only the: http://localhost:11093/SiteA/
I am using:
Path.GetFileName(Request.Url.Host)
But only get the: localhost, and trying:
Path.GetFileName(Request.Url.PathAndQuery)
But get the whole address. Thank you very much.
Try this one: