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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:19:00+00:00 2026-06-07T00:19:00+00:00

I am creating an MVC Intranet app with windows authentication. The data being accessed

  • 0

I am creating an MVC Intranet app with windows authentication. The data being accessed is year specific, so I need a way to set a global variable, be it a session, or whatever, that must be set before any queries are performed.

I’ve not been able to find a way to force a user to login since they are already authorized via their windows login credentials so using attributes to force a login seems problematic.

I am finding that users could navigate to any particular page and attempt to pull data and create a bit of havoc without the year defined.

What I would like to do is force a user to a year select page to select the year which they wish to access if the year variable is not yet set.

I’ve checked related questions and they do not appear to provide answer to my current conundrum.

  • 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-07T00:19:05+00:00Added an answer on June 7, 2026 at 12:19 am

    You can write a custom ActionFilter, which you put on all your controllers (but not on the action where you have to select the year, of course). If year ain’t be selected, you redirect to the controller/action where you can choose the year.

    public class CheckYearAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if(<YEAR IS NOT SET>)//redirect
            {
                filterContext.Result = new RedirectToRouteResult(
                    new RouteValueDictionary {{ "Controller", "YourController" },
                                          { "Action", "YourAction" } });
            }
    
            base.OnActionExecuting(filterContext);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My ASP.NET MVC intranet app has a data repository that uses current user's Windows
I am creating an MVC app where I need to send out an email
I'm creating an intranet asp.net mvc application that everyone in the company should have
Hi I'm writing an ASP.Net MVC intranet application which is accessed via handhelds and
so I was going on creating my MVC 3 web app when it dawned
I'm creating an MVC 3 app that manages business for client companies. When deployed,
I'm creating my first ASP.NET MVC 3 website for my company's intranet. It's a
I am trying out creating Spring MVC app on SpringToolSuite (STS) IDE. I do:
I'm creating an MVC 3 application that needs to establish data validation rules at
I found a great tutorial on creating an MVC App from Scratch using Sencha

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.