Using asp.net MVC3, I have a partial view which requires remote validation. As I understand it this means it needs it's own controller, so I'm using Html.Action to call this view and it's controller.
I do however wish to still pass a model to Html.Action, just like I would with Html.Partial. How can I do this?
Html.Action has an overload that expects route values as an object. you could trying passing the model there and model binding will kick in. Your action has to be expecting a parameter of type Model though.
Html.Action("ActionName","ControllerName", Model)
You must pass the model with anonymous classes
@Html.Action("Menu", "MyController", new { data = Model.Foo.Bar})
[ChildActionOnly]
public ActionResult Menu(Bar data )
{
return PartialView("Menu", data );
}