Posted On: Feb 22, 2018
TempData in MVC is a dictionary object to store data temporarily. It is a TempDataDictionary class type and instance property of the Controller base class.
TempData can keep data for the duration of an HTTP request; in other words, it can keep live data between two consecutive HTTP requests. It will help us to pass the state between action methods. TempData only works with the current and subsequent requests. TempData uses a session variable to store the data. TempData Requires typecasting when used to retrieve data.
Never Miss an Articles from us.