What are the relationships between those (if there is any)?
I know that ViewBag can access ViewData, except that ViewBag is of type Dynamic.
In addition, ViewData is of type ViewDataDictionary.
Can anyone elaborate more on these, especially the relationship between the ViewData
and a view's Model
@model
if there is one?
UPDATE:
I just realized after doing some breakpointing and debugging that there is no relationship between a View's Model
property (razor's @model
) and its ViewData.
UPDATE:
Actually, I take that back. A View's Model is actually part of ViewData
located in its ViewData.Model
Now I'm just wondering about ViewData and ViewBag?