Are your hidden fields inside the UpdatePanel? That would cause results about like you describe.
Yes, they are. That's it, huh? Why is that?
Aaron
P.S. I redid my solution using cookies instead of hidden fields, which I'll post in a separate thread. The only reason I wanted to use hidden fields is that I'd heard you have a limit on the number of cookies you can set with JavaScript, and my form has at least a dozen scrolling divs and as many drag panels (on different tabs).
Then I realized 2 things: (1) that if a scrolling div or dragPanel is on a different tab, which means its Visible property is set to False, it doesn't "exist" as far as JavaScript is concerned. Also, (2) that you can trick the JavaScript cookie system to save all your stuff in one cookie by using a character other than '=' as your delimeter.
So through trial and error, I got it all working. Again, I'll post it later today and come back and put in a link to it. Somebody someday is going to find it useful. I'd still love to know why having my hiddenFields in the UpdatePanel produces this type of behavior though. Thanks.
UpdatePanels don't merge their updates with what's already there. They just re-render the UpdatePanel's div based on the postback, and completely replace what's in the UpdatePanel div. Your hidden fields, being inside that div, were getting overwritten each postback. If you moved them outside the UpdatePanel, it would work as you expect.
ah, now I get it. Thanks.
Aaron
No comments:
Post a Comment