1

Inside my ItemAdded function I want to check the last added item is a folde or not. How to check that.

aarpey
  • 158
  • 1
  • 3
  • 15

1 Answers1

2
public class ClassName : SPItemEventReceiver
{
    public override void ItemAdded(SPItemEventProperties properties)
    {
        bool isFolder = (properties.ListItem.Folder != null);
    }
}
Marek Grzenkowicz
  • 17,024
  • 9
  • 81
  • 111
  • I will check this and let you know. The code which I used to create folders in my event receiver is not working. Checking with that now. http://stackoverflow.com/questions/12676531/create-a-folder-in-document-library-using-sharepoint-event-receiver – aarpey Oct 01 '12 at 15:43
  • how to get the folder name ? i want to fetch the folder name and fetch the items inside the folder and apply view permissions on those items – samolpp2 Dec 22 '16 at 13:53
  • @SaMolPP I suggest you post it as a new question. I haven't been working with SharePoint for years now, so I won't be able to help here. – Marek Grzenkowicz Dec 22 '16 at 14:02