Documentation > CMS Template API Library > Asset > PublishUserId

PublishUserId

The user id of the user who last published the asset. Use User.Load to get the User object for this id.

Type

System.Int32

Value

The id of the user who last published this asset

Code Example

C#

Sample:
	Asset myAsset = Asset.Load("/PathTo/Asset");	
	if(myAsset.IsLoaded)
	{
		User usr = User.Load(myAsset.PublishUserId);
		if(usr != null)
		{
			Out.WriteLine("Asset published by: " + usr.Username);
		} 
	}

Connect with Crownpeak