I am developing an ASP.NET MVC 3 web application using Razor and C#.
I just discovered that I have some problems with global variables, probably because I am relati
You should probably use ViewData for this OR use the HttpContext. ViewData will only be valid for your current request so is generally a better alternative than directly using the session object since your data is removed and not available on the next request. Using the session object can suffer from multi request overlap issues.