By default, MVC uses {controller} / {action} / {id} for URL routing. Then we can access mydomain.com/Products/Details/1, etc.
Now I have another map route, which I called CategoryLandingPage .
routes.MapRoute( name: "CategoryLandingPage", url: "category", defaults: new { controller = "Category", action = "Index" });
Thus, it will show the entire category on the page.
Then I register another map route called CategoryDetails
routes.MapRoute( name: "CategoryDetails", url: "category/{categoryName}", defaults: new { controller = "Category", action = "Details", categoryName = UrlParameter.Optional });
When someone gets access to mydomain.com/category/cars , he will show all the products related to cars.
The same controller also has other actions, such as Create, Edit, Delete, and more .
Problems: when I turn to mydomain.com/category/create , it will go to the action Details . It does not go to the create action in the Contoller category.
How can I solve this problem?