Send items to the Recycle bin

Use the following code sample to move a news item to the Recycle bin:

In the code above, you first get an instance of the NewsManager class. You get the news item by its master ID. Next, you call the MoveToRecycleBin method of the news manager. Finally, you save the changes.

To move a dynamic content item to the Recycle bin, you can use the following code sample:

In the code above, you first resolve the dynamic content type by calling the ResolveType method of the TypeResolutionService class. Next, you get an instance of the DynamicModuleManager class and find the dynamic content item by its master ID. Finally, you call the MoveToRecycleBin method of the dynamic module manager and save the changes.

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?