MVC5 interview questions

Total available count: 28
Subject - Microsoft Technologies
Subsubject - MVC5

What is the difference between TempData.Keep() vs TempData.Peek()?

TempData.Keep() and TempData.Peek() are required to manage the TempData for subsequent requests.

TempData.Keep(): Keep maintains all the data and not to delete on the current request and It returns void. When a user wants to read on the data on current request and make it available to next request, Keep can be used.

TempData.Peek(): Peek maintains all the data with specific key and that key can be maintained in next request and it returns an object. When a user wants to read the using Peek that means the data will be available for next request also.

Next 3 interview question(s)

What is the difference between ViewData and ViewBag?
What is the use of TempData?
Where exactly filter will get executed in MVC application life cycle?