Skip Ribbon Commands
Skip to main content

Robin | zevenseas | SharePoint Blog

:

The zevenseas Community > Blogs > Robin | zevenseas | SharePoint Blog > Posts > Anonymous Application Pages
March 20
Anonymous Application Pages

I wanted to make an application page become accessible for anonymous users but I was constantly being prompted with a logon box whenever I told the the page that it should inherit from a custom class like so

<%@ Page Language="C#" MasterPageFile="~/_layouts/simple.master" Inherits="zevenseas.ApplicationPages.CustomClass"  %>

So what to do? Well the first thing I found that I should inherit my CustomClass from the UnsecuredLayoutsPageBase instead of the LayoutsPageBase. Secondly, by inheriting from this other page, I have gained access to the following property called AllowAnonymousAccess, which should be overriden like this:

    protected override bool AllowAnonymousAccess
    {
         get
         {
             return true;
          }
    }

Once overridden and setting it to true, your custom application page becomes accessible for anonymous users as well ;)

Technorati Tags:

Comments

Jagjit Assi

Great Stuff,
I was able to resolve my problem with login prompts using information on this page.
System Account on 21/04/2010 14:52

boro

Thank you. Your solution worked for me to. Thank you one more time.
System Account on 10/05/2010 11:26

Partially works

I did this and I am not prompted. However, the page displayed in the browser shows the error icon panel. Is there something else I need to do get the page to display normally?

Daryl
 on 12/04/2011 08:19
 

 Statistics

 
Views: 2505
Comments: 2
Tags:
Published:1523 Days Ago