Where the structure is based on navigating down a hierarchy stored in a database and a user can remove a category level from the path to move back up the hierarchy.
I want to use this structure for an eCommerce site with the following example url:
Where removing /sony+bravia+40+inch+1080p/ would call a controller and action for listing electrical/televisions.
Not sure whether to use MVC2 Routing, Url rewriting etc.
01-14-2011, 05:11 PM
svidgen
Sounds like URL rewriting would be best. It should be fairly easy to rewrite something like ...
Code:
/nav/a/b/c/ -> /nav.aspx?location=a/b/c
So, if you're using .NET's interface, you can either use the "User friendly URL's" wizard, or manually set up a rule with the Match URL -> Pattern [using regular expressions] like ...
Code:
^nav/([^/]+)/?$
And an Action -> Rewrite -> Rewrite URL like ...
Code:
nav.aspx?location={R:1}
Then have nav.aspx break the location GET variable apart on the slashes and process accordingly.
01-17-2011, 02:53 AM
vouzamo
Thanks for the reply.
Just wondered how I can locate a specific url from non-specific data e.g. gucci/guilty/30ml-perfume-gift-set
Do I need to include a unique id somewhere or is there something else I can do to use this non-specific data to look up the unique id.
I would prefer to use MVC2 framework. Can I use URL rewriting with MVC2 to call a controller and an action with some parameters?
Kind regards,
John Askew
01-19-2011, 02:46 PM
mmrcela
Hi Vouzamo and Svidgen,
I am looking for a Software Developer in Illinois for a full time position at our company. Do either of you guys know of anyone looking for a company change in Illinois? I would appreciate any leads, thank you.