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 non action attribute in mvc?
What is a glimpse?
Explain the need of display mode in mvc?
How can maintain session in mvc?
Why we need "Areas" in MVC?
What is mvc in simple words?
Is mvc only for web?
What is the difference between asynchronous and synchronous actions? When would you use asynchronous actions?
Mention how can maintain session in mvc?
Is there viewstate in mvc?
Is angular js mvc?
What is mvc core?