sharepointanonymousapplicationpage

How To Create an unsecured layout page in SharePoint that can be accessed by anonmyous (guest) users


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?


Solution

  • 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;   
             }   
    }