What is the use of keep and peek in “tempdata”?
Answer / 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 |
Steps for the execution of an MVC project?
List out a few different return types of a controller action method?
What are viewmodels in mvc?
Is mvc a structural design pattern?
What are the filter in mvc?
What is the advantage of using MVC pattern?
What is view engine in mvc?
What is mvc core?
What is cshtml in mvc?
What are action filters in mvc?
What is strongly typed view in mvc?
Is viewstate available in mvc?