I’m having hard time understanding the stateless issue with mvc.
Let’s say i have a screen with a list of people. i want to choose one of them, and once i selected this person i want to keep his ID, and from my left menu i want to open a screen with his orders, a screen with his account details….
In ASPX i would just keep his PersonID in the session, and use it all over the website.
How can i do the same in mvc? what if i keep his id in a public variable in a public static class? will it work?
Thanks.
Use a session, just as in ASPX.
With a static class with a static
PersonIDproperty, it will be shared by all users…Meaning every time you set the value, all users will get the same value : not exactly what you want, do you ?
http://msdn.microsoft.com/en-us/magazine/dd942833.aspx