Find the page address in .NET.
Does anyone know how I could programmatically detect the current full page address. We share our codebase across multiple clients in subdomains, and I'm trying to figure out which client is viewing the page to load the corresponding CSS, for example. red.website.com; blue.website.com; (I want to capture red or blue, in my code).
Many thanks. Apologies for the poor wording.
a source to share
The full path must be :?Request
.
Url
.
AbsoluteUri
Once you have Uri
(just Resuest.Url
) something like:
string color = uri.Host.Split('.')[0];
a source to share