Domanda di colloquio di SOTI

Difference between ViewBag and ViewData

Risposte di colloquio

Anonimo

30 apr 2018

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

Anonimo

29 apr 2019

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