Developer forum

Forum » Development » The delete method in Dynamicweb.content.page

The delete method in Dynamicweb.content.page


Reply
I'm working with the Dynamicweb.Content API. It seems that the Page.Delete() method deletes the page from the database (duh!).

But I would like a method, that puts the deleted page into the trashbin. Is that possible using the API, or do I need to develop my own function for that?


Replies

 
Nicolai Høeg Pedersen
Reply
Well - that is an error in the API...

The delete should of course move the page to the trashbin. The same goes for paragraph.delete.

You can move pages to the trashbin like this - it is recursive and moves paragraphs to the trashbin as well:
Dim p As Content.Page = Content.Page.GetPageById(19)
Dim tb As New TrashBin
tb.MoveToById(p.ID, p.Area.Name, p.MenuText, TrashBin.Type.Page, 0)

And move single paragraphs like this:
Dim p As Content.Paragraph = Content.Paragraph.GetParagraphById(19)
Dim tb As New TrashBin
tb.MoveToById(p.ID, p.Header, p.Page.MenuText, TrashBin.Type.Paragraph, p.PageID)

I've changed the API to do like this - will be available with the 7.1 release.

 

You must be logged in to post in the forum