Anyone who has used jQuery with .NET web applications has more than likely ran into problems where changes made on the client via jQuery don't necessarily persist to the web server during a postback (because of viewstate, security, etc.).
My scenario: I have a GridView with two different ASP.NET dropdowns. One of the dropdowns is populated during the page_load, while the other is left blank. The one that is left blank is populated like thus: when the user selects an item in the first dropdown it fires off an event that uses jQuery ajax to retrieve data from the web server, and this data is then returned to the client and populated into the second dropdown. It's all elementary, and easy and smooth to boot. I love it.
However, what I don't love is the fact that when the user selects an item in the 2nd dropdown (after it has been populated by a jQuery ajax call) and clicks the Save button (which causes a postback) then the dropdown selection comes up empty on the server end (which essentially means the server has no idea that the dropdown had items in it or that a user had selected an item in it). Obviously, this has to do with the fact that the dropdown is empty in the viewstate, and I fully realize the why behind this, but it leaves me very frustrated at trying to mix jQuery with .NET.
So my question is this: How do I go about using jquery to populate an ASP.NET dropdown and have the items in it persist through postback?
Thanks for the help!