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.6.308
Syntax bool RemoveAsset(
IAsset asset
)
Function RemoveAsset (
asset As IAsset
) As Boolean
bool RemoveAsset(
IAsset^ asset
)
abstract RemoveAsset :
asset : IAsset -> bool
Parameters
- asset
- Type: Ingeniux.CMSIAsset
The Asset to be removed.
Return Value
Type:
BooleanTrue if the child asset is successfully removed, false otherwise.
Examples
Example of RemoveAsset method in custom hook:
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