SharePoint 2010: Fetching Current Username Programmatically
In order to get the current login user of the selected SharePoint website we can use the following code snippet.
public string getUserName()
{
return SPContext.Current.Web.CurrentUser.Name;
}
Hope this helps
Cheers
Comments
Post a Comment