0

I want an URL like www.aaa.com/{Categoryname}/{ProductType}/{ProductName}

where Categoryname,ProductType,ProductName can change dynamically. ProductType and productname will be optional,categoryname is mandatory. How do I identify those requests? I want to pass CategoryID,ProductTypeID,ProductId Parameters to identify too.

Any ideas on how I could best set this up?

  • Add route https://learn.microsoft.com/en-us/aspnet/mvc/overview/older-versions-1/controllers-and-routing/creating-custom-routes-cs – Satpal Jul 14 '17 at 10:16
  • you can go with attribute based routing https://blogs.msdn.microsoft.com/webdev/2013/10/17/attribute-routing-in-asp-net-mvc-5/ – Tejas Vaishnav Jul 14 '17 at 10:28
  • you can go with attribute based routing. And why cant you use post ? then you can pass all these as in data part and it will not be visible in the query string . – Arunprasanth K V Jul 14 '17 at 11:14
  • how do i pass Id's which i don't want to display in URL – user3898267 Jul 14 '17 at 14:24
  • Possible duplicate of [Multiple levels in MVC custom routing](https://stackoverflow.com/questions/31934144/multiple-levels-in-mvc-custom-routing) – NightOwl888 Jul 14 '17 at 17:14

0 Answers0