I am building an intranet site in MVC3 @Razor. It is utilizing Windows Authentication. The problem I have is that all of the users in the database are listed by UserID. The default action in getting the user information from the Windows context includes the domain (e.g. domain\userid). Is it possible to change this to just get the userid and ignore the domain, without having to write a custom authentication process? Meaning User.Identity.Name is just the userid and not the domain and userid.
EDIT: This is based off of a membership model using the default membership.
EDIT: The problem has nothing to do with the display of the information. The issue is when the system gets the users information from Windows and then goes to get the membership information, can the domain be removed, so only the userid is passed instead of the domain and userid. All I want is to be able to pass the userid to the membership instead of the "domain\userid".
The following:
User.Identity.Name.Split('\\')[1];
will remove the domain part.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With