Thursday, June 16, 2011

How to make an application page (_layouts page) in SharePoint anonymous?

Scenario:
How to make an application page (_layouts page) in SharePoint anonymous?

Explanation:
The application pages (custom pages that are created inside the layouts folder) in SharePoint  will ask for authentication even when a user tries to access them from a site that is configured for anonymous access (public facing site).

Resolution:

  • Make sure that the application page is inherited from "Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase"
  • Override the AllowAnonymousAccess property and return true

If the application page does not have code-behind, the below snippet will mark the property "AllowAnonymousAccess" to true:

protected override bool AllowAnonymousAccess

    get
    { 
        return true; 
    } 
}
</script>



download file, (tested):
https://sites.google.com/site/nidovan82/WebTaggingDialog.aspx?attredirects=0&d=1


original post:
http://underthehood.ironworks.com/2010/11/how-to-make-an-application-page-_layouts-page-in-sharepoint-anonymous.html

No comments:

Post a Comment