What is the difference between viewdata and viewbag?
Answer / Suleman Ahmad Salmani
ViewData and ViewBag in MVC are used to pass data to the view from the controller. However, there is a subtle difference between them. ViewData is strongly typed (i.e., you have to specify the type of the data), while ViewBag is dynamically typed (i.e., you don't need to specify the type, and it automatically detects the data type based on the name).
| Is This Answer Correct ? | 0 Yes | 0 No |
What is razor in mvc?
Why is mvc important?
What are the steps for the execution of an mvc project?
What is database first approach in mvc using entity framework?
What are the exception filters in mvc?
What are the filters in mvc?
Does android use mvc?
what are the benefits of area in mvc?
What is MVC, MVP and MVVM pattern?
What is mvc ioc?
What is difference between razor and aspx in mvc?
What is spring mvc model?