Calling @Html.Partial to display a partial view belonging to a different controller [duplicate] Calling @Html.Partial to display a partial view belonging to a different controller [duplicate] asp.net asp.net

Calling @Html.Partial to display a partial view belonging to a different controller [duplicate]


That's no problem.

@Html.Partial("../Controller/View", model)

or

@Html.Partial("~/Views/Controller/View.cshtml", model)

Should do the trick.

If you want to pass through the (other) controller, you can use:

@Html.Action("action", "controller", parameters)

or any of the other overloads


As GvS said, but I also find it useful to use strongly typed views so that I can write something like

@Html.Partial(MVC.Student.Index(), model)

without magic strings.