【sharepoint】SPEventReceiverStatus.CancelWithRedirectUrl 出错的请看这里
如果你使用sharepoint 里的eventhandler,并在里面做了页面跳转,但是发现跳转失败的话,请注意,一定要先设置RedirectUrl,再设置Status。
三行代码的顺序一定不能错!
MSDN上都是错的,坑爹呀~~~~~
View Code
properties.Cancel = true;
properties.RedirectUrl = "/_layouts/CustomErrorPage/SiteCreationError.aspx";
properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl;
properties.RedirectUrl = "/_layouts/CustomErrorPage/SiteCreationError.aspx";
properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl;