Hi @David Thielen,
Yes, you could use the NavigationManager to get the domain name, and then use the host to split the domain and get the name.
More details, you could refer to below codes:
@inject NavigationManager Navigation
...
@code {
protected override void OnInitialized()
{
var uri = new Uri(Navigation.Uri);
var host = uri.Host;
var domainParts = host.Split('.');
if (domainParts.Length > 2)
{
// Return the first part as the subdomain
UniqueId = domainParts[0];
}
}
}
Url:
Result:
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.