Pages

Showing posts with label UnsecuredLayoutsPageBase. Show all posts
Showing posts with label UnsecuredLayoutsPageBase. Show all posts

Wednesday, July 20, 2011

How to Create a SharePoint Application Page for Anonymous Access

There are some occasions in which we need to give anonymous access to SharePoint Application Pages , but on that webapplication does not give  the anonymous access. Examples like Registration Page, Forgot Password page. So how to do that?
We need to do three things for that.
1. protected override bool AllowAnonymousAccess
        {
            get
            {
                return true;
            }
        }

2. Instead, you need to use another base class for your anonymous application page called UnsecuredLayoutsPageBase. MSDN reference at: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.unsecuredlayoutspagebase.aspx

3. Please make sure we don't use DynamicMasterPageFile="~/masterurl/default.master" your application layout pag .aspx file.
change it to MasterPageFile="~/_layouts/simple.master"