ASP.NET Core - Using TempData
TempData is next to ViewBag and ViewData a common way to handle data for Requests and Views.
ViewData and ViewBag is only available in the current request and current View. TempData has the functionality to store data from one request to another. Keys inside TempData will be removed if you read them once!
Read Blog Post
