Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Jan 15, 2008 09:00 AM|LINK
You need to handle the two separate scenarios separately.
#1 While handling a single web request, your controller will run, and then your selected view will run. Data can go from controller to view in ViewData and in TempData, or any of the mechanisms in #2 (but this would be odd).
#2 Data that needs to cross from one response to the next request. Here you can use the client (hidden form fields (look how ViewData is sent to the client in a web forms app), form fields, cookies), or held on the server: session, application or some persistent
Each option has different trade offs, and many many pages have been written about them. E.g. by default a session will not survive a server restart (including process cycling) or use of a server farm, but can be configured (at some incremental performance
overhead) to handle these cases.
The simplest, until you understand requirements in detail would be either hidden form fields (with some integrity verification) or use the web app's session (I would likely go for the latter as the easiest).