I am trying to make it possible so if someone tryes to go to /content they are sent to a specfic controller (in this case content and then the following details after in the url are passed as parameters.
the url is http://localhost:51118/content/1/7/test.html
i have tried:
routes.MapRoute("content", "content", new { controller = "Content", action = "Index", id = UrlParameter.Optional });
im trying to integrate a cms thats why the url is what it is
EDIT:
public class ContentController : Controller
{
public ActionResult Index()
{
var model = new Content();
return View(model);
}
}
Your route is not correct. You will get routed to the Content controller only when you will access the
http://localhost:51118/contenturl. If you want to specify more paramateres you should add more sections to your route.routes.MapRoute("content", "content/{id1}/{id2}/{content}", new { controller = "Content", action = "Index"});