You can redirect user to a custom message page with code.
Here is the code for that.
///Thank you !!!/// An item is being added. /// public override void ItemAdding(SPItemEventProperties properties) { base.ItemAdding(properties); // Any condition if (properties.ListItem["Manager"] != SPContext.Current.Web.CurrentUser.LoginName) { // Set the status property to CancelWithRedirectUrl this tells the event handler to cancel the operation properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl; // Get the application page generic with SPUtility properties.RedirectUrl = SPUtility.GetGenericSetupPath("/MyProj/MyPage.aspx"); } }
No comments:
Post a Comment