Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am new to MVC, can anyone tell me where can we check Session value in mvc3.

I have 5 controllers and in each controller there are nearly 50 actionresult methods.

Do I need to check the session value in each and every method?

--
Thanks,
Gopi.
Posted

You need to check Session value on Action Result of your Page in which you want to use that Session Value.

Hope this link might help you to understand the Concept:

http://www.tyronedavisjr.com/2008/11/23/detecting-session-timeouts-using-a-aspnet-mvc-action-filter/[^]
 
Share this answer
 
Comments
Gopi9999 16-May-12 7:24am    
Hi, Thanks for the reply... that link was very good.. but what I need is after knowing that the session has expired, immediately the user should be navigated to the Login Page by not executing the lines of code in the ActionResult method.
Can anyone please give any idea on my question?

--
Thanks,
Gopi.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900