Hi, I'm trying to build up a proper routing scheme for my products section in MVC 2. I've got the following criteria:
Links of the format
/Products/(MX[0-9]+)
and /Products/(BDL[0-9A-Z_])
Need to route to ProductsController.Show(Id = $1)
Links of the format
/Products/([a-zA-Z0-9/]+)
Example: http://www.mysite.com/Products/Cameras/Digital/
Need to route to ProductsController.List(Category = $1)
Then on top of this, I want links like
/Products/AddToCart/{1}
to work normally.
So far I've been able to get the above two to work fine through a relatively hack-ish method (all past /Products/
is routed to show, where some conditional logic redirects to .List(Category) if the start of the input isn't MX
or BDL
I'm not happy with the current implementation and am open to some help. Thank you in advance.