Click or drag to resize

IAssetFolderRemoveAsset Method


Removes a specified asset from the context asset folder.

Namespace:  Ingeniux.CMS
Assembly:  Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 10.3.169
Syntax
bool RemoveAsset(
	IAsset asset
)

Parameters

asset
Type: Ingeniux.CMSIAsset
The Asset to be removed.

Return Value

Type: Boolean
True if the child asset is successfully removed, false otherwise.
Examples
Example of RemoveAsset method in custom hook:
C#
int outVar;
IAssetFolder baseFolder = session.Site.AssetFolder("af/5");
foreach(IAsset asset in baseFolder.DescendantAssetsWithMaxDepth(out outVar, 10).Where(a => a.Name == "Delete")){
    baseFolder.RemoveAsset(asset);
}
See Also