jjc99
jjc99

Reputation: 3569

Render a partial view from an action within another area

I have an ASP.Net MVC project that is split into 'areas'

On a view in area 'A' I wish to render a partial view via a controller within area 'B'.

I have the following within my View inside area 'A'

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

This doesn't seem to work.

Does anyone know how to do this?

Upvotes: 5

Views: 9834

Answers (1)

user1968030
user1968030

Reputation:

use this

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

or this

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

Upvotes: 6

Related Questions