I want to cancel the WebAdding event and have the user redirected to an error page. Seems simple enough. But I cant get it to work. Heres my code:
public override void WebAdding(SPWebEventProperties properties)
properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl;
properties.RedirectUrl = "/_layouts/Custom/error.aspx";
The code executes fine but I get a "File not found" error in the browser afterwards. The ULS logs tells me that someone is trying to use a closed SPWeb (Detected use of SPRequest for previously closed SPWeb object...).
The event handler should prevent my users from creating subsites, but they should be able to create Meeting Workspaces. So it wont be enough to remove the CreateSubweb permission from the permission mask.
Thanks in advance,
View Complete Post