Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
342 Points
59 Posts
Apr 23, 2012 02:02 PM|LINK
You can try something like the following:
string userName = HttpContext.Current.User.Identity.Name.ToString(); int stop = userName.IndexOf("\\"); userName = userName.Substring(stop + 1, userName.Length - stop - 1); //username without the domain part
Please "Mark as Answer" if this helped you
bakra
Member
342 Points
59 Posts
Re: Change LoginView domain\username to username
Apr 23, 2012 02:02 PM|LINK
You can try something like the following:
string userName = HttpContext.Current.User.Identity.Name.ToString();
int stop = userName.IndexOf("\\");
userName = userName.Substring(stop + 1, userName.Length - stop - 1); //username without the domain part
Please "Mark as Answer" if this helped you