URL rewriting issue. When i call me url using the following link
http://localhost:12719/product/18
it works fine the product 18 links to the parameter. However when i call it using the following.
http://localhost:12719/product/apple
It doesn't map the apple product name to the controller, it thinking that your trying to invoke a action of type apple.
Why does it map numeric and not string to the controller parameter? The controller parameter is an type of string.
Routing are as below.
routes.MapRoute(
name: "product",
url: "product/{id}/{slug}",
defaults: new { controller = "product", action = "product", slug = UrlParameter.Optional },
constraints: new { id = @"\d+" }
);