Mention what is the difference between temp data, view, and view bag?
Answer / 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 |
What is the benefit of using mvc?
How can we implement validation in mvc?
How can you maintain session in mvc?
Explain the MVC pattern with example
Why is mvc good?
What is mvc httppost?
What are the filters in mvc?
Is there viewstate in mvc?
Why is mvc better than webforms?
What are the types of filters in mvc?
What are corpus tools?
What is razor view engine in mvc?