I have a web app (ASP MVC2) where some forms can be accessed via multiple routes, initially once a form was complete a user was kicked back to a default page for that form rather than the page they entered it from.
Now I'm redesigning a sizable area I want to address this, I want a solution that is easy to add in. I have a couple of ideas but I'm not sure which to go with, I do know that I want it to be "invisible" (ie not touching my URLs).
So I'm thinking either:
I could have hidden fields for the referrer page on the forms.
Alternatively I could use TempData and have an attribute that handles checking and adding the referrer URL (this would likely include a string for each of the different pathways so that a user could have 2 different forms open and not have the referrers interfere).
The problem with the form value is that it would require putting non-model related fields in each of the views and would break if there's ever any GET requests in the workflow. it would also require manually handling this property in each view and action.
The TempData+attribute approach would be a much neater way to apply this but it's possible for powerusers who are doing many things at once to have conflicting referrers for the same forms.
I'm leaning towards the latter approach as it's more elegant and easier to keep track of as I don't see there being many of the edge cases where it gets overridden but I'm worried about the user experience for if it does happen. Is the trade off worth it?