I have an ASP.Net MVC search page. It's a fairly standard list, but has a couple of dropdowns that filter the results. Those dropdowns and the search text input tag are wrapped in a form tag.
I also have a "Add New [entity]" hyperlink. The hyperlink goes to a Create view.
The thing is, the dropdowns from the search form also dictate values for some of the fields on the Create view. So I need to pass their values to the Create form.
The most straightforward way to do this (that I know of) would be to pass the relevant values in the Add New hyperlink's query string.
I can achieve this by changing the HREF value of my link every time a dropdown changes. But that involves several event handlers, and some of the dropdowns already have other event handlers tied to them. (There's a dependency between two of the dropdowns, just to make things more complicated.)
What I'd like to do is change the query string — gather the current values of the dropdowns and change it — between the click on the hyperlink and the actual execution of the hyperlink. Or emulate that happening.
Is this possible? And is it a good idea, or should I just stick with multiple event handlers changing the HREF?