Wednesday, July 15, 2009

Designing anonymous application page in SharePoint

Hi All,

Today I am going to discuss on how to design anonymous access application page. This is a common problem that many company developer faces. They always ask that designing such a page is always difficult. You will have site running in windows authentication or in forms authentication. If the entire site is anonymous then it is altogether a different story.

So let us discuss how we can design such application page that can be accessed by the anonymous users as well.

Normally we inherit the application page by LayoutPageBase class, right? Yes, so first thing to note is instead of inheriting from this class, we are required to inherit from class named UnsecuredLayoutsPageBase.

In addition to this, you also need to override one more method which is

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


Once you are done with these two settings, you are done with this. Try to achieve this and let me know your feedback.

Thank you

2 comments:

Adeel Ansari said...

But nothing is happening,the result is same, it every time redirect to the customize login page .What should i do ??

Parth Patel said...

first you have to allow webapplication to anonymous access from central admin.

else webapplication setting it self redirects you to login page.




Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com