【sharepoint】SPEventReceiverStatus.CancelWithRedirectUrl 出错的请看这里
2011-12-19 23:22
344 查看
如果你使用sharepoint 里的eventhandler,并在里面做了页面跳转,但是发现跳转失败的话,请注意,一定要先设置RedirectUrl,再设置Status。
三行代码的顺序一定不能错!
MSDN上都是错的,坑爹呀~~~~~
View Code
properties.Cancel = true;
properties.RedirectUrl = "/_layouts/CustomErrorPage/SiteCreationError.aspx";
properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl;
三行代码的顺序一定不能错!
MSDN上都是错的,坑爹呀~~~~~
View Code
properties.Cancel = true;
properties.RedirectUrl = "/_layouts/CustomErrorPage/SiteCreationError.aspx";
properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl;
相关文章推荐
- SharePoint【事件处理器】-- SPEventReceiver的一点总结
- SharePoint 2010中, SPEventReceiverBase.EnableEventFiring和DisableEventFiring都已废弃(obsolete), 应使用SPEventReceiverBase.EventFiringEnabled
- HTTP Status 500 - attempt to create saveOrUpdate event with null entity的错误及解决办法
- Working with BeforeProperties and AfterProperties on SPItemEventReceiver
- SharePoint 2010 创建SPSite对象出错,提示“找不到位于 http://xxxx 的 Web 应用程序。请确认正确键入了此 URL
- RHEL6.3启动出错init:rcS post-stop process (1005) terminated with status 1
- ionic get,post返回Response with status: 0 for URL: null
- Working with BeforeProperties and AfterProperties on SPItemEventReceiver
- [SharePoint 2013] Create event receiver for external list
- sharepoint2010 SPSite 出错提示“找不到位于 http://xxxx 的 Web 应用程序。请确认正确键入了此 URL。”
- ORA-27300: OS system dependent operation:spcdr:9261:4200 failed with status: 997
- SharePoint 2010部署WCF续 - feature event receiver实现自动部署
- SharePoint v3:忘掉模拟用户Impersonate,SPSecurity.RunWithElevatedPrivileges来了
- linux安装scrapy出错'x86_64-Linux-gnu-gcc' failed with exit status 1
- sharepoint 一个有用的方法SPSecurity.RunWithElevatedPrivileges(delegate(){})
- SharePoint中的EventReceiver 之二 绑定Event Receiver到列表类型或列表实例
- 为incoming mail绑定事件,SPEmailEventReceiver
- hive job执行出错--提示Execution failed with exit status 2
- How to redirect to a Custom Page for Event Receiver in SharePoint 2010
- SharePoint 2013 app 实战之 RemoteEventReceiver