1 Answer

0 votes
by

ViewData: It is available for the current request only and requires typecasting for complex data type.

ViewBag: Dynamic property that takes advantage of the new dynamic features in C# 4.0, also available for the current request only. If redirection occurs, then its value becomes null and doesn’t require typecasting for complex data type.

TempData: used to pass data from the current request to the next request, keeps the information for the time of an HTTP Request. This means only from one page to another.

...