Answers for "asp.net mvc temp data"

C#
0

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
Posted by: Guest on July-31-2021

Code answers related to "asp.net mvc temp data"

C# Answers by Framework

Browse Popular Code Answers by Language