TempData is used to pass data from current request to subsequent request, this means redirecting from one page to another. It’s life is very short and lies only till the target view is fully loaded. But you can persist data in TempData by calling Keep() method.
If you want to keep value in TempData object after request completion, you need to call Keep method with in the current action. There are two overloaded Keep methods to retains value after current request completion.
Calling this method with in the current action ensures that all the items in TempData are not removed at the end of the current request.
@model MyProject.Models.EmpModel;
@{