I have a document library with a
ItemAdding event receiver registered to it that looks for whether a folder has been added and if so, cancels the folder creation.
This works fine in the GUI. However, when in Explorer view, although the event receiver fires, the event is not cancelled.
I have ran the debugger in Visual Studio and the below two lines are definitely being executed, so I can't understand why the event is not being cancelled?
properties.Status = SPEventReceiverStatus.CancelWithError; properties.ErrorMessage = "You cannot create folders here.";