如何在 SharePoint 中创建可由匿名(来宾)用户访问的不安全布局页面

发布于 2024-08-05 23:55:07 字数 372 浏览 3 评论 0原文

我正在尝试做一些应该非常简单的事情。

我创建了一个部署到 _layouts 文件夹中的 SharePoint 应用程序页面。此页面使用继承自 Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase 的自定义代码。

我的应用程序页面引用了一个母版页,最好将其描述为“最小母版页”(它具有所有基本的 SharePoint 内容占位符,仅此而已)。

但是,当我尝试使用配置为允许匿名访问的 Web 应用程序访问该页面时,仍然会提示我登录该页面。我已经检查了母版页库和样式库的权限。这些配置为允许匿名访问。

我从未创建过可以通过匿名帐户访问的应用程序页面,但它应该是可行的。

有解决此问题的想法吗?

I'm trying to do something that should be really simple.

I have created a SharePoint Application page that is deployed into the _layouts folder. This page uses a custom code behind that inherits from Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.

I have the application page referencing a master page that can be best described as Minimal Master Page (it has all of the basic SharePoint content placeholders and that is about it).

But when I try to access the page using a Web Application that is configured to allow anonmyous access I still get prompted to login to the page. I've checked permissions on the Master Page Gallery and Style Gallery. These are configured to allow anonmyous access.

I've never created a Application Page that can be accessed by anonmyous account, but it should be doable.

Any ideas for troubleshooting this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

开始看清了 2024-08-12 23:55:07

此处找到了我的问题的答案

简而言之,您有覆盖AllowAnonymousAccess 属性并返回true。一旦我这样做了,页面就会按预期工作。

protected override bool AllowAnonymousAccess
{   
      get{   
             return true;   
         }   
}   

Found the answer to my problem here

In a nutt-shell you have to override the AllowAnonymousAccess property and return true. Once I did that the Page works as expected.

protected override bool AllowAnonymousAccess
{   
      get{   
             return true;   
         }   
}   
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文