I have a Customer list that will have Invoices and Emails linked to it.
I have my customer/details/1 and customer/edit/1 working as per the default route but would like to have it instead be like below
- customer - Lists customers
- customer/1/edit - Edit Customer ID 1
- customer/1/details - Details of Customer ID 1
- customer/1/invoice - Invoice List for Customer ID 1
- customer/1/invoice/3 - Details of Invoice ID 3 for Customer ID 1
I setup the following route (before the default route)
routes.MapRoute("CustomerActions",
"customer/{customerid}/{action}/{id}",
new { controller = "customer", action = "details", id="" }
);
Which seems to work, but in my customer edit view I have an ActionLink like
<%=Html.ActionLink("Back to List", "Index") %>
But it gives the URL
/customer/1/index rather than just /customer or /customer/index