ASP.NET MVC Dynamic Action with Hyphens

NexT

New Member
I am working on an ASP.NET MVC project. I need to be able to map a route such as this:http://www.mysite.com/Products/Tennis-ShoesWhere the "Action" part of the URL (Tennis-Shoes") could be one of a list of possibilities. I do not want to have to create a separate Action method in my controller for each. I want to map them all to one Action method and I will handle the View that is displayed from there.I have this working fine by adding a route mapping. However, there are some "Actions" that will need to have a hyphen in them. ASP.NET MVC routing is trying to parse that hyphen before I can send it to my action. I have tried to create my own custom Route Handler, but it's never even called. Once I had a hyphen, all routes are ignored, even my custom one.Any suggestions? Details about the hyphen situation? Thanks you.
 
Back
Top