Configured Route:
routes.MapRoute(
name: "RedirectToProduct",
url: "product/page/p{productId}/{shortName}",
defaults: new { controller = "Product", action = "RedirectToProduct", shortName = UrlParameter.Optional }
);
Action Method:
public class ProductController : Controller
{
public async Task<ActionResult> RedirectToProduct(string productId, string shortName)
{
}
}
Problem..
- When I hit url http://localhost:1234/product/page/p1185/ , then I am getting call in controller's action method
- BUT when I hit url http://localhost:1234/product/page/p118.5 , I am NOT getting call in controller's action method. I see HTTP Error 404.0 - Not Found (See there is DOT (.) in productId.)
What I want is- whether I add DOT (.) in the end OR not in productUd parameter, call should go in the controller's action method.
Thanks in advance!