I’m developing a search that have a dynamic number of checkboxes and a price range. I need a route that maps something like this:
/Filter/Attributes/Attribute1, Attribute2, Attribute3/Price/1000-2000
Is this a good way to do that? How can I do that route?
and in your Index action:
where
FilterViewModel:and if you wanted your FilterViewModel to look like this:
you could write a custom model binder for this view model which will parse the various route tokens.
Ping me if you need an example.
UPDATE:
As requested here’s a sample model binder that could be used to parse the route values to the corresponding view model properties:
which would be registered in
Application_StartinGlobal.asax: