Oguz Karadenizli
Oguz Karadenizli

Reputation: 3505

RenderAction from another controller in AttributeRouting

I'm using AttributeRouting extension with Asp.Net Mvc 4 RC. It is ok for calling RenderAction from same controller. But when I called it from another controller's view I got "No route in the route table matches the supplied values" exception.

PS:I've tested Asp.Net MVC 4 RC without AttributeRouting. Everything is fine.

Upvotes: 1

Views: 1381

Answers (2)

Oguz Karadenizli
Oguz Karadenizli

Reputation: 3505

The problem is related with "AREA". You could not call RenderAction from another area, you have to add :

@{Html.RenderAction("Index", "Message", new { area = "" });}

Upvotes: 3

CodeMad
CodeMad

Reputation: 948

I think you have replaced all general routes with your own custom routes in Global.asax.
Can you please put the general route ({controller}/{action}) back into the file? It should work.

If that doesn't work then you may have to provide [ChildActionOnly] attribute in your action.

Upvotes: 0

Related Questions