You can use @Html.Action which will let you invoke a controller action and render its respective view.
<body>
@Html.Action("MyAction", "MyController")
</body>
where MyAction
is an action within MyController
which returns a view.
You can also apply the ChildActionOnly
attribute to that action to ensure that the only way it can be invoked is through the Action
method.