Hi,
I'm looking for a best practice suggestion.
I've got a ShoppingBag Controller with a Partial that lists all the items in the user's bag. In this Partial you can remove items from the bag via a form post.
The Partial has been place in a Master Page which is referenced by each of the Views in the Controller. When an item is removed from the user's bag, I'd like the user to be redirected to the originating View. I'm quite happy with how I would achieve this with JavaScript, it is the non JavaScript I am not clear about.
Do I:
- Detect the referring Action using Request.UrlReferrer and redirect. This could be quite laborious detecting the Action/Route from a URL.
- Pass a hidden field with the Post. Not really keen on the thought of bloating the HTML.
- Don't redirect to originator, redirect to a confirmation page. Would prefer to avoid if possible.
- Something I've missed.
Any helped would be appreciated.
Rich