Is it possible to have a action method with a name that is different to the action name specified in the url? I tried doing this with the routes table in Global.asax with no luck. Here’s what I tried:
routes.MapRoute(
"ApproveSellers",
"Admin/Account/ApproveSellers/",
new { controller = "Account", action = "ApproveSeller"},
new[] { "UI.Areas.Admin.Controllers" }
);
I want the action method to be called ApproveSeller but the url to be ApproveSellers.
You need to do it using action attribute. In the route, you just define the default value.
Here is in the controller: