Reputation: 3252
routes.MapRoute(
name: "RedirectToProduct",
url: "product/page/p{productId}/{shortName}",
defaults: new { controller = "Product", action = "RedirectToProduct", shortName = UrlParameter.Optional }
);
public class ProductController : Controller
{
public async Task<ActionResult> RedirectToProduct(string productId, string shortName)
{
}
}
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!
Upvotes: 2
Views: 1132
Reputation: 13541
If the dot is the problem, like product/page/p118.5
, then add runAllManagedModulesForAllRequests = true
to your web.config, like:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
...
</modules>
</system.webServer>
Upvotes: 2