Created
June 10, 2016 01:47
-
-
Save KennethanCeyer/24b9fa87d0f2145e0ebf95d90a2c0c19 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override void Initialize(RequestContext requestContext) | |
{ | |
base.Initialize(requestContext); | |
string domain = Dns.GetHostEntry(this.Request.UserHostName).HostName; | |
string[] segments = domain.Split('.'); | |
string subdomain = ""; | |
if(segments.Length >= 3) | |
{ | |
subdomain = segments[0]; | |
if(subdomain != "www") | |
{ | |
Session["company_entry"] = subdomain; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment