I have an area called MyArea and it's registered like so:
context.MapRoute(null, "MyArea", new { controller = "MyAreaController", action = "Index" });
//Properties
context.MapRoute(null, "MyArea/properties", new { controller = "Property", action = "Index" });
context.MapRoute(null, "MyArea/properties/edit/{propertyId}", new { controller = "Property", action = "Property" });
//Units
context.MapRoute(null, "MyArea/properties/edit/{propertyId}/units/{unitId}", new { action = "Unit", propertyId = 1, unitId = 1 });
It should work that one property has many units, so I would like my url to look something like this:
http://localhost:50182/myarea/properties/edit/4/units/1
The code i use for the Html.ActionLink looks like:
@Html.ActionLink("Add new Unit", "Unit", "Unit", new { propertyId = 1, unitId = 1 })
I have an Unit controller with an action called Unit. Pleas help, what am i missing?
Thanks!!