In previous releases there were 3 ways to pass data from controller to view AFAIK (shown below).
I want to use method (2) with MVC Beta 1, but I can’t find the renderView method. So what’s the new syntax (if it’s still possible)? Thanks in advance.
Ben.
Syntax #1: Old-school dictionary
ViewData['Name'] = 'Moo-moo'; ViewData['Age'] = 6; ViewData['HasFunnyFace'] = true; RenderView('ShowCat');
Syntax #2: Explicitly-typed ViewData object
RenderView('ShowCat', new ShowCatViewData { Name = 'Moo-moo', Age = 6, HasFunnyFace = true });
Syntax #3: Anonymously-typed object
RenderView('ShowCat', new { Name = 'Moo-moo', Age = 6, HasFunnyFace = true });
In beta 1, use the View method:
The View method has replaced the RenderView method.