Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public override void ItemAdding(SPItemEventProperties properties)
- {
- if (properties.ListItem["updating"].ToString() == "updating")
- {
- properties.Cancel = true;
- properties.ErrorMessage = "Item is currently updating, please try again later";
- }
- else
- {
- properties.ListItem["updating"] = "updating";
- this.DisableEventFiring();
- properties.ListItem.Update();
- this.EnableEventFiring();
- // do your stuff
- properties.ListItem["updating"] = "";
- this.DisableEventFiring();
- properties.ListItem.Update();
- this.EnableEventFiring();
- }
- }
Add Comment
Please, Sign In to add comment