I have the following Route defined in Global.asax:
routes.MapRoute(
"IncidentActionWithId", // Route name
"Incidents/{companyId}/{action}/{id}", // URL with parameters
new { controller = "Incidents" } // Parameter defaults
);
I have a special case of request, like this one:
/Incidents/SuperCompany/SearchPeople/Ko
In this case, action should indeed map to SearchPeople
action, comapnyId
to this action's parameter, but only when action is SearchPeople, the Ko
should not be mapped to an id parameter of the action, but to searchTerm
.
My action declaration is:
[HttpGet]
public ActionResult SearchPeople(string companyId, string searchTerm)
How can I achieve Ko
to be mapped to searchTerm
parameter in my action method?