I'm trying to make a custom application page which can be viewed by anonymous users. So far I've:

  • Inherited the code behind from UnsecuredLayoutsPageBase
  • Overriden AllowAnonymousAccess to always return true
  • Enabled anonymous access for the web application in central admin

but still it requires me to login to see the page. Any ideas how to fix it?

  • There must be something on the page which doesn't allow Anonymous Access! Either a List View Web Part, or any other thing! Commented Dec 3, 2012 at 14:38
  • 2
    Create a totally blank aspx page as per: hughajwood.wordpress.com/2012/11/08/… and see if that works with the anonymous permissions.
    – Hugh Wood
    Commented Dec 3, 2012 at 14:49
  • Cheers, that worked :)
    – user12959
    Commented Dec 3, 2012 at 15:04

1 Answer 1


Since it worked, I will post as the answer so it's clear.

1) Create a new blank SharePoint 2010 project targeting .net 3.5 framework and any processor and target your test SP2010 site

2) Add new reference to the SharePoint built in folder _Layouts

3) I recommend you create a sub folder in here to keep your custom files in nice and neatly, so make an External folder for this example

4) Add a new Application Page to the External folder and call it blanktest

5) Delete the designer page (not needed)

6) In the aspx page delete EVERYTHING but the following two lines:

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="blanktest.aspx.cs" Inherits="Your.Namespace.Here" %>

7) Deploy

8) Browse to your site http://[site]/_layouts/External/blanktest.aspx

There you have it, a 100% blank aspx page that you can do ANYTHING with.

This method is almost identical to making a ashx HTTP Handler, except instead of inheriting Page you Inherit HTTPHandler with your default function being:

public void ProcessRequest(HttpContext context).

Quoted from my blog post here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.