Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Mention what is the difference between temp data, view, and view bag?

Answer Posted / Satish Chandra

In MVC Model View Controller, TempData is a helper class that allows you to store values that need to be displayed or passed from one action method to another during a single request. It's used for temporary storage of information between calls to different controller actions within the same request. ViewData and ViewBag are ways to pass data from the controller to the view in ASP.NET MVC applications. They allow you to populate data into strongly-typed views or Razor views. The main difference lies in their usage: ViewData is a dictionary object that uses string keys, while ViewBag dynamically creates an anonymous type with property names matching the C# identifier case of the property name set on it.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is latest mvc version?

2