Documentation > CMS Template API Library > Asset > ModelId

ModelId

Gets or sets the model id. This is initialized if the asset has a model. For folders. This is the id of a folder whose children show up in the "New" menu when this folder is selected. If there is no model, -1 is returned.

Type

System.Int32

Value

The model id.

Code Example

C#

Sample:
	Asset myAsset = Asset.Load("/PathTo/AssetOrFolder");	
	if(myAsset.IsLoaded)
	{
		Out.WriteLine("ModelId: " + myAsset.ModelId);
	}

Connect with Crownpeak