Documentation > CMS Template API Library > User > Load(String)

Load

Returns a new user object populated with the user specified by username. Returns null, if not found

public CrownPeak.CMSAPI.User Load(String)


Returns

Returns the User object specified by username.

Parameters

NameDescriptionType
userName The user name to search for. System.String

Code Example

C#

Sample:

            User theUser = User.Load("usersname");
            if (theUser != null)
              Out.WriteLine("Hi " + theUser.Firstname);
            
            

Connect with Crownpeak