asp.net mvc temp data
TempData good to knows:
- IMPORTANT! TempData is discarded after the next request completes!!
- Assume that the data is in string format
- You can have multiple variables stored
Usage:
String example:
string message = TempData["message"]; // Get data from TempData
TempData["message"] = message; // Set data into TempData
Int example:
int number = Int.Parse(TempData["message"]); // Get data from TempData
TempData["message"] = message; // Set data into TempData