0

I have written some C# code which will recycle a folder based on the path it is passed, however, when it is executed the folder goes to the SiteCollection recycling bin and not the first level recycling bin for the team site.

                     SPFolder folder = web.GetFolder(folderPath);
                            if (folder.Exists)
                            {
                                web.AllowUnsafeUpdates = true;
                                folder.Recycle();
                                folder.Update();
                                web.AllowUnsafeUpdates = false;
                            }

How do i send the folder to the team site recycling bin and not the site collection? Thanks in advance!

  • The code listed will put the folder in the recycle bin for the web (and in the end user site collection recycle bin) – Per Jakobsen Oct 3 '12 at 19:41
  • When i check the team site recycle bin the items do not show up, they do, however, show up in the parent site collection recycling bin. – ps_md Oct 3 '12 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.