Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC call Html.Action within area?

Tags:

I have an AREA called "Admin"

It uses the same layout page as the rest of my site. In the layout page I have

 @Html.Action("MyMethod", "MyController", null)  

MyController is not in the Admin area but at the root/controllers folder when I go to any page in side the AREA I get the following execption

"The controller for path '/admin/home' was not found or does not implement IController"

like image 227
Daveo Avatar asked Feb 21 '11 04:02

Daveo


1 Answers

Try like this:

@Html.Action("MyMethod", "MyController", new { area = "" })  
like image 192
Darin Dimitrov Avatar answered Sep 30 '22 16:09

Darin Dimitrov