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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:56:36+00:00 2026-06-03T23:56:36+00:00

Within my ASP.NET App I am using a Method to check user permissions to

  • 0

Within my ASP.NET App I am using a Method to check user permissions to decide whether the user can view the page, or get redirected to the “Invalid Permissions” page.

Since adding this Permission Redirect on the Master Page would cause an infinite loop, I am forced to apply it to all pages. I do not want to have to copy this Method onto every page, so I would like to create a class within my Web App which holds this Method so I can use it globally across my app.

I have had no formal training, but my gut is telling me that it’s bad practice to place a Response.Redirect or any “Web” functions in a class? Am I correct? And if so, is there a better way to go about this?

  • 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-03T23:56:38+00:00Added an answer on June 3, 2026 at 11:56 pm

    You can check the current url to make sure that it is not already the invalid permissions page before redirecting; therefore, you will only redirect when you are not already there.

    if(!Request.RawUrl.Contains("Invalid Permissions Page"))
        Response.Redirect("Invalid Permissions Page");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using a cache manifest file within ASP.NET can I just add a standard
I have an asp.net web app that is using an iFrame (called fraContent) within
I'm starting the development of a C#/ASP.net web app, within which I use the
-- Running within ASP.NET MVC alongside jQuery -- I'm using jQuery to render a
I am using the jQuery nyroModal plugin within ASP.Net. I love nyroModal, and overall
I am using quartz.net to schedule regular events within asp.net mvc application. The scheduled
I have used JQuery within my asp.net page. JQuery is working fine. I could
I'm using Linq to SQL within an ASP.NET MVC application. The model consists of
I've discovered recently that when using the Session or Application objects within an ASP.net
I'm currently using ASP.NET MVC3 and MongoDB for a web app. MongoDB uses UTC

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.