SharePoint 2010 Get Current Username / Logged in User
Sarah Angell
Dec 2, 2011
1 min read
Update 05/12/2011As my colleague Colin pointed out - the name that appears on the top right can really be anything and can change - for example if a user gets married and their name changes. A better approach would be to retireve the value programmatically using SPServices ( http://spservices.codeplex.com/wikipage?title=$%28%29.SPServices.SPGetCurrentUser ). As of version v0.6.1, you can also request the ID of the user by specifying fieldName: "ID". Much more stable to use in most scenarios:$().SPServices.SPGetCurrentUser({ fieldName: "ID", debug: false});
Comments