Reputation: 237
So I have a view with a treeview. When you select a node from the treeview, a view should appear next to the treeview. This is easy. You just call the controller from the view and load it into a div like this:
LoadUserControl('@Url.Action("ViewName", "Controller")', { 'parameter': parameter}, $("#div"));
This works perfectly if the view you are calling is in the same area where you are currently working in. However this doesn't work when it is in another area. When you make the call the controller you are looking for can't be found. Anybody has an idea how to do this?
I'm using asp.net mvc3, c#, jquery and html
Upvotes: 1
Views: 773
Reputation: 1038810
You could specify the area name in the routeValues
parameter of the Url.Action
helper:
var url = '@Url.Action("SomeAction", "SomeController", new { area = "AreaName" })';
LoadUserControl(url, { 'parameter': parameter}, $('#div'));
Upvotes: 3