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

  • Home
  • SEARCH
  • 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 8342903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:54:04+00:00 2026-06-09T05:54:04+00:00

I am developing an MVC app in which data is year specific. So, I

  • 0

I am developing an MVC app in which data is year specific. So, I need to make sure the working year is set before any data is queried. I asked this question before and received the response here. This works just fine to redirect the users to another page. However, this is problematic because the session expiring (I do not want it to be a no expire session). So, if there is inactivity for the session to expire and the user is in the middle of an operation, I do not want the page to be reset because of a redirect to another page to select the year.

After that long introduction (apologies, I wanted to make it clear what I was needing), I ask, is it possible to create a modal dialog if the session is null?

For example:

if (Session["Year"] != null)
{
    ...
}
else
{
    modal dialog to set year and go on our merry way...
}

I looked at examples for jquery UI, but it does not seem to address my particular conundrum.

Thanks for any help.

  • 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-09T05:54:05+00:00Added an answer on June 9, 2026 at 5:54 am

    Yes, here is the jQuery UI component for dialogs. You have to place it in your view though, so you’ll have to pass whatever session value you have to the view so that you can do a logical test there.

    http://jqueryui.com/demos/dialog/

    UPDATE:

    You can create a view that will hold your dialog box. Next you will override the OnActionExecuted Controller action which gets executed on every request. In this action you will do your session check.

    Then you will use ViewBag to pass a value to your master/layout view. In that view just do a logical check for the ViewBag value, and show the dialog box appropriately.

    if (Session["Year"] != null)
    {
        ...
    }
    else
    {
    @Html.Raw(@"
    <script type='text/javascript'>
       $(document).ready(function(){ 
          $('#dialogID').dialog('open'); //I am not sure if this is proper way to open it
       });
    </script>")
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Developing a Sencha Touch MVC app that pulls data from json store (thats set
I am developing asp.net mvc web app with MongoDB as the data storage. I
I am developing an asp.net MVC web app in which I am using Linq
I am developing an ASP.NET MVC app and I've been looking into using Data
I'm developing an ASP.NET MVC app. I'm working with Syncfusion's PdfDocument (ver 7.303.0.20) in
I'm developing a swing app which suits the MVC pattern and I'm wondering about
I'm developing a MVC 3 Razor Web App, in which details of multiple categories
I am developing an MVC app that retrieves data from a table in SQL
I'm developing a web app with MVC 2.0. I'm storing my data in Windows
I am developing an app in asp.net mvc 2.0 in which I want 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.