MVC Routing for categories with spaces
I have a website that has categories for the products. I wanted to have the categories defined in a route pretty much like www.domain.com/categoryA.
Here's my problem what if I have category in my database that is 'Box开发者_Python百科ing Gloves' how do I handle the space in the category name?
You can have spaces encoded as %20, but that doesn't really make for pretty urls. I'd suggest you convert them to dashes and disallow dashes in category names. You could also disable spaces and force users to use dashes like most tagging systems.
精彩评论