Saturday, February 5, 2011

asp.net mvc renderaction

<%Html.RenderAction("Index", "Test", New With {.pagetmp = "test"})%>

I call the above line in my asp.net mvc view. How do i retrieve the dictionary values from the test controller?

  • You can pass information using ViewData e.g. ViewData["MyDictionary"] = myDictionary;

    From Rick
  • You can't. The point of RenderAction is to let the controller you're calling do what it normally would without you worrying about what's happening. Maybe a partial view might be better suited for you in your case, it's hard to say without seeing the big picture...

    From BFree

0 comments:

Post a Comment