Pages

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"

9 comments:

  1. It still does not work. Please help

    ReplyDelete
    Replies
    1. Hi Divyesh

      So which Error still you are getting? Did you follow all these three steps?

      Disha Shah

      Delete
  2. I have tried this code and it's working fine. It will help me in my Sharepoint Development projects. Thanks for sharing..

    ReplyDelete
    Replies
    1. Sunny

      Thank you and I am glad it helped you in your project!!!Keep it up the good work.

      Disha Shah

      Delete
  3. Thank you Disha for this post. It solved my issue.

    Take Care.

    Manny

    ReplyDelete
    Replies
    1. I am glad it helped you in your work!!!

      Keep coding!!!
      Disha Shah

      Delete
  4. Hi Disha,
    I want to develop a registration page in sharepoint2013.
    Email, Password,confirmpassword.
    and this data should store in a sql.
    This is internet project.
    Please guide me.

    Thank you,
    Sowjanya.

    ReplyDelete