0

In my mvc3 (razor) application i want to handling session timeout by displaying a popup for re entering User id and password

How can i write it as common in Session_End() in Global.asax

Is it possible to display a jquery model popup from here

Is there any way to implement this without losing data please share..

2
  • displaying jquery modal popup from a Session_End .... is something I dont think is possible. Commented Aug 21, 2012 at 12:16
  • Avoid using seasion_end because the event does not fire if you deploy to muti web server environment. The action filter alone with combination of view logic to display login dialog should be enough. Commented Aug 22, 2012 at 0:59

1 Answer 1

1

You can do it with session_end in combination with an action filter and jquery.

  1. Set HttpContext.Current.Items['sessionEnded'] to true in Session_End()
  2. Create an action filter which checks for that Item and set ViewBag.SessionEnded to true
  3. In your layout trigger the javascript if ViewBag.SessionEnded is true.
Sign up to request clarification or add additional context in comments.

3 Comments

if you dont mind could u please share about creating action filter
First hit in google for c# create actionfilter: asp.net/mvc/tutorials/older-versions/controllers-and-routing/…
couldn't get HttpContext.Current in session_End(). it shows Object reference not set to an instance of an object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.