Get the current user in Sharepoint site
By Perry
This shows a method for Geting the current user who using the Sharepoint site.
When you want to display welcome message to the user who is using your sharpoint site, you can simply add below method in your webpart code.
Protected override void RenderContents(HtmlTextWriter writer)
{
writer.Write("Welcome {0}.", SPContext.Current.Web.CurrentUser.Name);
}
Simple! You can also view my other sharpoint related FAQs listed below.
Related FAQs
This shows how to Create Custom Properties for Sharpoint WebParts?
This shows how to Configure List and Item level security in Sharepoint 2007?
This shows procedure for Configuring Site level security in sharepoint 2007.
This shows complete procedure to create and integrate custom webpart in Sharepoint 2007.
This shows how to Create Mailbox and configuring Sharepoint outgoing email settings?
This thread shows how to Create Active Directory User accounts and Groups.
Get the current user in Sharepoint site (3922 Views)