In previous releases, there were 3 ways to transfer data from the controller to view AFAIK (shown below).
I want to use method (2) with MVC Beta 1, but I cannot find the renderView method. So what is the new syntax (if it is still possible)? Thanks in advance.
Ben.
Syntax # 1: Old School Dictionary
ViewData["Name"] = "Moo-moo";
ViewData["Age"] = 6;
ViewData["HasFunnyFace"] = true;
RenderView("ShowCat");
SyntaxC # 2: Explicit ViewData p>
RenderView("ShowCat", new ShowCatViewData {
Name = "Moo-moo",
Age = 6,
HasFunnyFace = true
});
SyntaxC # 3: Anonymously Typed Object
RenderView("ShowCat", new {
Name = "Moo-moo",
Age = 6,
HasFunnyFace = true
});
source
share