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 9204043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:36:45+00:00 2026-06-17T23:36:45+00:00

My question is almost similar to this ASP.Net Roles: Page-Level Security Question except for

  • 0

My question is almost similar to this
ASP.Net Roles: Page-Level Security Question
except for the fact that I’m not using asp.net membership, What I have done is I have created roles and assigned pages to roles, menus are also populating according to the user’s role. I want to restrict user to access pages by simply typing the PageName.aspx , One solution might be checking on every page load, but I don’t think it’s efficient. I have googled but only found solutions for adding <location path="Logon.aspx"> to restrict, I have to add this for every page in web.config, which defeats the whole purpose of keeping this thing dynamic, I am using Form Authentication, Some are suggesting creating a Base Class and derive other pages from that class, I think there may be some global.asax way to acheive this, but have no idea. Please suggest me best approach to achieve this !

P.S : I am not using ASP.NET Membership

  • 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-17T23:36:47+00:00Added an answer on June 17, 2026 at 11:36 pm

    finally, what I did is I checked access of Pages for every user on MasterPage’s Page_Load using a method name IsPageAssignedToRole() to check

            string requestedPage = Request.Url.Segments[Request.Url.Segments.Length-1];
            if (requestedPage != "UnAuthorized.aspx")
            {
            AdminUserAuthInfo au = (AdminUserAuthInfo)Context.Items["AdminUserAuthInfo"];
            int current_role= int.Parse(au.Roles[0].ToString());
            if (!AdminRole.IsPageAssignedToRole(current_role, requestedPage))
            { Response.Redirect("UnAuthorized.aspx",true); }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My question is almost exactly similar to this one . However , I'm not
This question is very similar (or almost identical) to In a non blocking socket
This question is geared towards MySQL, since that is what I'm using -- but
This is a question about LINQ the .NET language feature, not LINQ to SQL.
This is almost similar question to this one: - Dealing with timezones in PHP
There are a lot of asked questions with almost similar titles with this question
Update : I found almost exact similar question , yet it has slightly different
I am almost embarrassed to ask this question, but as a long time C
This is almost certainly a very silly question, but for some reason I'm having
I have two almost similar source code trees, but do not have access to

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.