Answer Posted / Gyanendra Kumar
In ASP.NET MVC, TempData maintains data for a single request and response cycle by default. However, there are two special methods available: Keep and Peek. Keep adds the data to TempData with a duration of one additional request, ensuring that it survives the immediate response and remains accessible in the next controller action. On the other hand, Peek retrieves data from TempData without removing it, allowing you to check its value before adding or replacing anything.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers