hi i am trying to create a URL that looks like this:
black/granite/worktops
where the black and granite will change so i have tried to create my own routes in global.asax.cs like so:
routes.MapRoute("Kitchen", "kitchen/[color]/[surface]/[type]",
new {controller = "kitchen", action = "surface"});
changing the URL to kitchen/black/granite/worktops
this way i thought i could create a controller called kitchen with an action called surface my code for this looks like so:
public ActionResult surface(string color, string surface, string type)
{
ViewData["color"] = color;
ViewData["surface"] = surface;
ViewData["type"] = type;
return View();
}
however i cant seem to get it to work, i get the error 404 for this URL despite my custom mapping, can anyone point me in the direction of reading, i have been reading this page here: http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx
this is what gave me the idea, as he has query and page the code is a little owt of date as i am using MVC preview 2
many thanks