I guess the routes topic had been raised many times. However I haven't found my case.
So, I have a plugin with admin side functionality. I have registered admin side controller actions this way:
var route = routes.MapRoute("Plugin.Payments.Deposit.Admin.List",
"admin/deposit",
new {controller = "AdminDeposit", action = "List", area = "Admin"},
new[] {"Nop.Plugin.Payments.Deposit.Controllers"}
);
route.DataTokens.Add("area", "admin");
routes.Remove(route);
routes.Insert(0, route);
When I access this action with URL http://host/admin/deposit it works fine. But the view has Kendo Grid, which calls another action:
@Html.Raw(Url.Action("DepositList", "AdminDeposit"))
This generates following URL:
"/Admin/AdminDeposit/DepositList"and requesting this URL results HTTP 404.
But when I type such URL for primary action:
http://host/AdminDeposit/List, another URL for Kendo Grid is generated:
"/AdminDeposit/DepositList"and requesting this URL returns proper data.
I don't understand why in first case
"/Admin/AdminDeposit/DepositList"is generated. I have no route mapping for action DepositList.