Hi all, I am building a MVC application in asp.NET for a web portal. I have prepared a series of controllers, and mapped all the paths that don't macth to this to a Page controller, which will render the appropriate page.
My default route works like this:
routes.MapRoute(
"Default",
"{level1}/{level2}/{level3}",
new { controller = "Page", action = "Index", level1 = "home", level2 = "", level3 = "" }
);
But this has fixed width, it will accept only up to 3 levels. Moreover, I'd like to manage actions appended to the path, like "edit" and "delete". Is this possible?
company/about/who_we_are/staff -> Controller: Page, Action: Index, Parms: company/about/who_we_are/staff
company/about/who_we_are/staff/edit -> Controller: Page, Action: Edit, Parms: company/about/who_we_are/staff
company/edit -> Controller: Page, Action: Edit, Parms: company
Or is there a better way to model this? All the paths to the pages are in the database, so they change dynamically.