TempData - Transfer data between controllers

Ideal for transferring small amounts of data between controllers in ASP.NET MVC.

Unlike ViewData and ViewBag, which are specific to a single view, TempData persists for one request cycle.

This means the data remains available until it’s accessed, at which point it’s automatically removed.


👉 Adapted from my original post on LinkedIn .