I have one sharepoint application, in this i have to show the current user, i used SPContext.Current.Web.CurrentUser.LoginName. then it returns XXXXXX\abida. But i want only the username like abida. How to achieve this requirement?
I have one sharepoint application, in this i have to show the current user,
Share
Note that we have to escape the slash…
I presume you are doing this in order to use the name-only for some reason and that you aren’t relying on the user name being unique in its own right. You could have DOMAIN1\BobSmith and DOMAIN2\BobSmith – so if you were using “BobSmith” as a unique user name, you could come unstuck.