ProgrammerGuide.Net | Step by Step Programmer Guide

Difference Between TempData ,ViewData And ViewBag in ASP.NET MVC | ASP.NET MVC Interview Question


Temp data
Temp data in MVC helps to maintain data when you move from one controller to other controller or from one action to other action. It internally uses session variables.
View data
View data in MVC helps to maintain data when you move from controller to view.
View Bag
view bag in MVC is a dynamic wrapper around view data. Type casting is not required when using view bag. It uses the dynamic keyword internally.
Please click here for related products on Amazon!

Jayashee

Add comment

Want to Check Celebrities News?