SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi In a claims based SP site and we have multiple membership roles. I have lot of application pages in the layouts folder is there an effective way (apart from handling them in code behind) to authorize application pages in the layouts page based on roles (only certain membership role can view a particular page others will redirected to custom no access page). Any helpful suggestions and links would be very helpful. Thanks.

share|improve this question

If you can't find another answer besides the codebehind (I doubt you will) simply create a base class for your pages that applies the rule:

public class MembershipRoleLayoutsPageBase : LayoutsPageBase
     public override void OnInit(EventArgs e)
          //check permissions, redirect otherwise

On MyAppPage1.aspx

public class MyAppPage1 : MembershipRoleLayoutsPageBase  
  // page stuff
share|improve this answer

You can play with Web.Config and try applying ASP.NET Membership: Role Based Security..

As it was previously asked on Stack Overflow: Securing Application Pages in SharePoint 2010

share|improve this answer

Your Answer


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.