Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8308613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:51:45+00:00 2026-06-08T18:51:45+00:00

I am using FormsAuthentication and ASP.NET Memberships and Roles in my ASP.NET project. I

  • 0

I am using FormsAuthentication and ASP.NET Memberships and Roles in my ASP.NET project. I have some aspx files which can be viewed / accessed by only authenticated users. I think I can do this using one of the following two ways.

  1. Configuring the web.config file. Allow users with roles ‘admin’ and ‘members’ to access those apsx files, and deny all other anonymous users.

  2. In page_load events of those apsx files, just checking whether the curent user is authenticated or not using HttpContext.Current.User.Identity.IsAuthenticated

I am wondering whether these two approaches are equivalent or not for apsx files.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:51:47+00:00Added an answer on June 8, 2026 at 6:51 pm

    They are not equivalent. Method 1. gives access only to the “admin” and “members” roles. If you add another role, they won’t have access. Method 2 lets any signed in user access the data.

    I think that the preferred way is to organize the aspx files in directories depending on what roles should access them. Then configure access on the directories in web.config.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed an application in ASP.NET 3.5 which utilizes the Membership and Roles
I have an ASP.NET MVC project in C# using Forms Authentication and Active Directory
I have a website created with ASP.NET and a web service, both using FormsAuthentication
I am using asp.net forms authentication, membership provider and role provider. You can refer
I see the guidance when using formsAuthentication in ASP.NET is to use SSL via
My asp.net application is not using formsauthentication. Instead we make a call to database,
I am using Asp.Net/C# in my project.I am using Forms Authentication .Currently I call
I have an ASP.NET 3.5 app using Forms Authentication. It would be nice to
I have an ASP.Net MVC application and I'm using Forms authentication in SQL Server.
I have an ASP.NET web application that is using forms authentication. Everything is configured

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.