How to get subdomain name in codebehind
Hi rohanp,
Refer the below code.
Uri fullPath = new Uri("http://subdomain1.domain.com"); string hostName = fullPath.Host; string[] domains = hostName.Split(new char[] { '.' }); string subDomain = domains[0]; string domain = domains[1];
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.