How are you using the word "domain"? Do you mean Windows Domain - as in
a Domain Controller? In this case, you should be able to get the domain
name which is prefixed on the user's name (Page.User.Identity.Name) if
you have Windows Authentication enabled on the website (and anonymous
access disabled).
You then write logic to show different interfaces based on that domain
string.
You could even write a custom RoleProvider which uses the person's
domain name to determine their role. That way you could take advantage
of the role-based security built into the new ASP.NET 2.0 sitemap and
Navigation controls. That would allow you to declaratively decide which
navigation links will be displayed to each domain. For more info on role
based site navigation, check out this article:
http://weblogs.asp.net/scottgu/archi...20/431019.aspx
For help writing a custom RoleProvider, you can download my Visual
Studio template from here:
http://flimflan.com/blog/ASPNETRoleP...oTemplate.aspx
Just fill in the code for GetRolesForUser() to return the user's domain
name. Something like this:
public string[] GetRolesForUser(string username){
int domainPos = username.IndexOf('\');
string domain = String.Empty;
if (domainPos > 0) {
domain = username.SubString(0, domainPos);
}
return new string[] { domain };
}
Joshua Flanagan
http://flimflan.com/blog