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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:42:04+00:00 2026-06-05T12:42:04+00:00

Hi, I got a ASP.NET MVC website where end users can create account. I

  • 0

Hi,

I got a ASP.NET MVC website where end users can create account. I do however need them to grant a agreement first time thay login and if not, then thay should not be able to get to any other webpage on this site while thay are logedin.

Is this possible, and if so how?

  • 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-05T12:42:07+00:00Added an answer on June 5, 2026 at 12:42 pm

    An easy way would be creating a custom authorize attribute. The below authorize attribute checks if the user is authenticated and authorized and if yes the you have make db call to know if the user is confirmed and return false if not setting a private variable isNotConfirmed to true.

    In the HandleUnauthorizedRequest you have to check why the auth. failed and if it i due to not confirmed then you can redirect the user to a confirm page.

    public class CustomAuthorize : AuthorizeAttribute
      {
        bool isNotConfirmed = false;
    
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {      
          if (base.AuthorizeCore(httpContext))
          {
            //if the user is not confirmed set isNotConfirmed true and return false;
            isNotConfirmed = true;
    
            // else return true;
          }
    
          return false;
        }
    
        protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
        {
          if (isNotConfirmed)
          {
            filterContext.Result = new RedirectResult("/Confirm");
          }
          else
          {
            base.HandleUnauthorizedRequest(filterContext);
          }
        }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a website in ASP.NET MVC 3. People can send messages to other
I've got a simple ASP.NET MVC website. It has Debug, Testing and Release configuration
I've got several pages on my ASP.NET MVC 3 website (not that the technology
I've got an ASP.NET MVC 3 website and I wish to incorporate a simple
I got a ASP.NET MVC 2.0 Preview 1 app and started to create some
I've got an ASP.NET MVC site up and running, but need to make one
I've got my little asp.net mvc app working as expected, however I'm building the
I've got a asp.net mvc application with session state enabled (sqlSessionProvider). End user will
We've got an asp.net mvc website that is currently in a private beta state.
I've got an asp.net mvc application that uploads a file and stores them in

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.