I've looked for this for a while and the solutions look like they should work, it appears I'm doing it wrong.
I created an area for administering the CMS side called "manage" so if you go to:
/Manage/Vinyard
it will give you a list of vinyards to manage using VinyardController built with the CRUD scaffold.
On the "front end" I have a browse controller and another VinyardController for viewing the details of a vinyard.
So someone goes to
/Browse/Vinyard
it gives them a list of Vinyards, they click on one (here's the problem) I want it to go to
/Vinyard/NameOfVinyard
The route that I have is:
routes.MapRoute(
"Vinyard",
"Vinyard/{Name}",
new { controller = "VinyardController", action = "Details", area="root"}
);
Which is above the default route. Details is the method that displays the Vinyard details.
the HTML.actionlink I'm using is:
@Html.ActionLink(item.Name, "Details", "vinyard" ,new { name = item.VinyardId, area="root" })
for some reason the a tag that's returned is: /Browse/Details?Length=7
On top of that when I try to browse to /vinyard/1 it gives me a 404.
Thanks for your help!
Update: If I browse to /vinyard/details/1 it works properly, except that I want it to eschew the /details/ part.