当前位置: 代码迷 >> SharePoint >> SharePoint撤消登录返回当前页面
  详细解决方案

SharePoint撤消登录返回当前页面

热度:121   发布时间:2016-05-02 07:04:36.0
SharePoint取消登录返回当前页面
在SharePoint访问需要权限的文件时,需要登录。
但是有时不想登录,点取消后就显示“401 UNAUTHORIZED”。有什么方法能够使取消登录回到原来的页面,而不是“401”页面。
------解决方案--------------------
使用重定向的方法试试 
Microsoft.SharePoint.Utilities.SPUtility.EnsureAuthentication(); Microsoft.SharePoint.Utilities.SPUtility.EnsureAuthentication(); 

This will redirect unauthenticated users to the login screen and show users access denied screens if applicable.这将未经验证的用户重定向到登录屏幕,显示屏幕的用户访问被拒绝如果适用。 
It's that simple.  You don't have to check to see if the user is authenticated or anything like that, that functionality is already built in to that function.就是这么简单。您不必检查,看看用户进行身份验证之类
------解决方案--------------------
SharePoint这一点是比较烦人的,如果是自定义的页面,可以使用楼上的方法,不是自定义而是SharePoint原生的页面,没有办法额。
  相关解决方案