Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
    
There must be something on the page which doesn't allow Anonymous Access! Either a List View Web Part, or any other thing! –  Arsalan Adam Khatri Dec 3 '12 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 Dec 3 '12 at 14:49
    
Cheers, that worked :) –  ng93 Dec 3 '12 at 15:04

1 Answer 1

up vote 0 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.