Reliable, User-friendly, Fine and Fast :
RUFF Works is committed to Help/Support/Services in IT industry. Also helping programmers IT professionals, C#,ASP.NET, Microsoft, Oracle and lot of other technologies.

Thursday, October 13, 2011

Allow anonymous access to SharePoint in the _layouts directory

Allow anonymous access to SharePoint in the _layouts directory

Allowing anonymous access

To do this we have to inherit from our page from "UnsecuredLayoutsPageBase" instead of "LayoutsPageBase". This is a base class for application pages that do not require the user to have any permissions.

Open up [YourPgae].aspx.cs

By default, the page is inherited from "LayoutsPageBase". Change the inheritance from "LayoutsPageBase" to "UnsecuredLayoutsPageBase".

public partial class [YourPgae]: UnsecuredLayoutsPageBase

Next, we need to override a property of the UnsecuredLayoutsPageBase, to allow the anonymous access. Be sure to change the 'getter' to return true