I have a search form in an app I'm currently developing, and I would like for it to be the equivalent of method="GET".
Thus, when clicking the search button, the user goes to search.aspx?q=the+query+he+entered
The reason I want this is simply bookmarkeable URLs, plus it feels cleaner to do it this way.
I obviously don't want all the viewstate crap hidden fields appended to the URL either.
The best I could come up with for this is:
a) either capture the server-side click event of the button and Response.Redirect
b) Attach a Javascript onclick handler to the button, and to window.location.replace
Both feel quirky and sub-optimal... Can you think of a better approach?
I'm guessing this is one solid answer to my previous question: Why does the ASp.Net Web Forms model suck?