What is TempData in MVC?

  • Sharad Jaiswal
  • 22nd Feb, 2018

1 answer(s) :

  •   Reply

    Priyag Chaudhary

    13th Feb, 2020

    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.

Post your Answer :

Valid name is required.

Valid name is required.

Valid email id is required.