I'm re-building a site that's had lots of SEO work done to it. Currently built in ASP.NET web forms, I'm re-building in ASP.NET MVC.
All links have been "re-written" for SEO purposes. Examples: - If you search for "foo", the search result URL will be "foo-stuff-for-sale", if you search for "bar", the URL would be "bar-stuff-for-sale" - you get it. - The search results are "categorized" - i.e. categories are "widgets", "clocks", "clothing"...where the search term is contained in some portion of the products under each category - If you click on a link from a category, the resulting search page would go back to the same search result, but without the category that was clicked on. i.e. - search for "foo", click on a link under "widgets", you'd go back to "foo-stuff-for-sale", but the "widgets category wouldn't show.
With Web Forms, this was being accomplished by a property in the .ascx page that was displaying the links and would be stored on the link itself somehow so that the link handler would be able to grab it and omit stuff from that category.
How do I accomplish the same thing using ASP.NET MVC and razor templates?
I've thought about:
- Cookies - set the cookie using jQuery.cookie on click from a "data-category" attribute, read the cookie in the controller and then remove the cookie on display.
- jQuery - setting something else on the query string onClick that the controller can read, but then doesn't show in the URL upon display.
UPDATE: Additional context: This was done in the old implementation via a session variable. I'm doing all I can to get rid of session state for this new implementation.
Thoughts? Ideas?