What is TempData in ASP.NET MVC?

Updated Apr 28, 2026

Short answer

TempData stores data for the next request.

Deep explanation

TempData uses session internally and is useful for passing data between redirects.

Real-world example

Displaying success messages after redirect.

Common mistakes

  • Assuming it persists permanently.

Follow-up questions

  • What is session?
  • Why TempData?

More ASP.NET MVC interview questions

View all →