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..

Nithesh Narayanan
  • 11,481
  • 34
  • 98
  • 138
  • displaying `jquery modal popup` from a `Session_End` .... is something I dont think is possible. – Yasser Shaikh Aug 21 '12 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. – Roman Aug 22 '12 at 00:59

1 Answers1

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.
jgauffin
  • 99,844
  • 45
  • 235
  • 372