We want to “replay” a complex filter ui once the request has been exectued and the user comes back to the filter page.
Since the filter is very complex and dynamic we don’t want to walk through all items and remember the selected values and then apply the saved values from the code – the post data contains all selected options anyway…
So the goal is to intercept a !IsPostBack request, check if we have a saved filter for the scenario, inject the saved post data into the request and then go on and let all ASP.NET controls do their work as if it was a postback.
What we’ve tried so far:
- Server.Transver preserving the Form is a nice idea, but the Request.Form is a readonly colletion.
- creating a new HttpWebRequest to the same page with custom post data seems to stall the IIS worker process.
- Not sure if an IHTTPHandler can modify the Post data or if that is already too late?
Any ideas? This would be really cool and extremely flexible for replaying any kind of requests…
We ended up remembering the selected values in Session and then apply when the page is reloaded like this:
define
save
apply