I have my default MVC routes setup as:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
What I want to be able to do is have the following routes in my Search controller hit.
.../Search/Uk
.../Search/Uk/County/Buckinghamshire
.../Search/Uk/City/London
.../Search/Uk/Town/Ashford
.../Search/Uk/Postcode/AB-Aberdeen
I only have one view called "Index". As I understood routing I presumed I should of been able to do something like this:
public ActionResult Index(string country)
public ActionResult Index(string country, string searchType, string location)
But no cigar, anyone understand what I'm doing wrong, do I need to add in some sort of routes configuration? Infact implementing this I cannot even load the search page