Is it possible to overload the action methods based on number of parameters in request?
Eg:
1.
domain.com/List/Filter/ByName
invokes -> public ActionResult Filter(string criteria1)
2.
domain.com/List/Filter/ByName/ByRanking
invokes -> public ActionResult Filter(string criteria1, string criteria2)
I’m using asp.net mvc2.
If I’m not mistaken the best way to do this would be to add two different controller methods and map them to two different Urls.
Then you have two route definitions:
This will map this URL
List/Filter/xxCriteria/to the first controllerThis will map this URL
List/Filter/xxCriteriaName/xxxCriteriaRankto the second controller. Without this route you could still map a url to the second method, but it would look like :List/Filter/?criteria1=xx&criteria2=xxHope it helped.