ASP.NET MVC: ViewData & ViewPage ViewData Controller

I can't seem to find a "link" between the controller's ViewData collection and the ViewPage's ViewData collection. Can anyone point me to where in the MVC framework the control ViewData collection gets wrapped into the ViewPage ViewData collection?

I've spent quite some time using Reflector to try and work with this, but I'm obviously not looking in the right place.

0


source to share


1 answer


The Controller.View method passes the ViewData to the ViewResult.

ViewResult.ExecuteResult carries this over to its ViewContext.



In WebFormView, the private RenderViewPage method passes the ViewData from the context argument to the view itself. Another species in genes may work differently.

+2


source







All Articles