The user click on delete document library but this document library have documents.!! So i want stop the action and send a message "The DL have files, please del first documents."
I think one way to do this is using event receiver.
Something like this:
public override void ListDeleting(SPListEventProperties properties) { if (properties.List.Items.Count != 0) { properties.Status = SPEventReceiverStatus.CancelWithError; properties.ErrorMessage = "The DL have files!!'"; } base.ListDeleting(properties); }
But im not having sucess!! Any help.
Thanks