Reputation: 451
My application reads barcodes from a USB scanner. I treat them as tokens and then build commands from those tokens. There may be a situation that I need 2 or more reads before I can create a command. I need to store previous reads in some way. How can I keep some data between request? I do not to use that tokens in my view.
Only results of commands may be displayed in the view.
Upvotes: 15
Views: 18404
Reputation: 1154
The TempData
dictionary is ideal for storing data between controller actions. It's most commonly used in the Post/Redirect/Get pattern but could apply here.
This is a good article to read about it: http://www.devcurry.com/2012/05/what-is-aspnet-mvc-tempdata.html
Upvotes: 15
Reputation: 1038710
Here are a couple of possibilities that come to mind:
On the client:
On the server:
Upvotes: 9