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

Load

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

public CrownPeak.CMSAPI.User Load(Int32)


Returns

Returns the User object specified by userId.

Parameters

NameDescriptionType
userId The user id to lookup. System.Int32

Code Example

C#

Sample:

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

Connect with Crownpeak