asp.net mvc - How to send model object in Html.RenderAction (MVC3) -
asp.net mvc - How to send model object in Html.RenderAction (MVC3) -
i'm using mvc3 razor, , i'm trying pass object partial view, , it's not working.
this works fine without sending object model partial view:
html.renderaction("index", "viewname");
trying doesn't sent model object, i'm getting nulls instead (the object has data, , view expects it):'
html.renderaction("index", "viewname", objectmodel);
is possible using renderaction?
thanks!
edit: found error, there error controller's action didn't pick sent object. help!
say want pass foo
model, create first
public class foo { public string name { get; set; } public int age { get; set; } }
now create actionresult
public actionresult foobar(foo _foo){ homecoming partialview(_foo); }
call
@html.renderaction("foobar", "controller", new { name = "john", age=20 });
asp.net-mvc asp.net-mvc-3 razor asp.net-mvc-partialview
Comments
Post a Comment