vote up 0 vote down
star

Hello,

I seem to be unable to find the "link" between a controller's ViewData collection and a ViewPage's ViewData collection. Can anyone point me to where in the MVC framework a controlle's ViewData collection is transferred to a ViewPage's ViewData collection?

I have spent quite a lot of time using Reflector to try and work this one out but I'm obviously not looking in the right place.

flag
add comment

1 Answer

vote up 1 vote down

The Controller.View method transfers the ViewData into the ViewResult.

ViewResult.ExecuteResult transfers this into its ViewContext.

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

link|flag
add comment

Your Answer

Get an OpenID
or

Not the answer you're looking for? Browse other questions tagged or ask your own question.