Extract partial view of action in another area

I have an ASP.Net MVC project that is divided into "areas"

When viewing in area "A" I want to do a partial view through the controller in area "B".

I have the following inside the viewport "A"

Html.RenderAction("Index", "AreaBHome", new { Area="AreaB"}); 

This does not work.

Does anyone know how to do this?

+4
source share
1 answer

use this

  Html.RenderAction("action", "controller", new { area = "Area", model = ViewData.Model }).. 

or

 @Html.Partial("~/Views/ControllerName/_PartialView.cshtml", Model) 
+5
source

All Articles