note: not duplicate of this question not answer question completely.
my question stored when assign value viewdata or viewbag tempdata resides in session.
both resides in session too?
if not where?
as @slicksim mentioned in comment, stored on heap reference types in .net.
viewbag of type dynamic but, internally system.dynamic.expandoobject()
it declared this:
dynamic viewbag = new system.dynamic.expandoobject(); which why can :
viewbag.foo = "bar"; inheritance hierarchy:
system.object system.dynamic.expandoobject for more info on expandoobject
please go through this article on value type, reference type, heap , stack on codeproject may understand both viewdata , viewbag reside.
i hope helps!
Comments
Post a Comment