SOTI interview question

Difference between ViewBag and ViewData

Interview Answers

Anonymous

30 Apr 2018

Viewbag uses properties, viewdata is an array. E.g: ViewBag.foo = foo, ViewData["foo"] = foo.

Anonymous

29 Apr 2019

ViewBag is dynamic and properties are accessed using . operator whereas ViewData is a Dictionary