views:

24

answers:

1

I have a gridview control that extends the default gridview. I have added an attribute called "hiddenSelectedValues" to to the gridview during the "PreRender" event and I have a private variable that points to the value of that attribute.

I have some javascript code that modifies the value of this attribute based on the user checking or unchecking checkboxes in the grid. I have confirmed that the javascript is indeed modifying the value of the "hiddenSelectedValues" attribute by using Firebug to see the change as it happens.

However, once a postback occurs, the grid looses the updated value of this attribute and I am unable to reference get the updated value on the server side.

How do I keep the value of an attribute changed by javascript on postback?

+1  A: 
Paulo Santos
Well I originally tried using a hiddenfield but since this is a gridview control I had to put the hiddenfield in one of the rows (header, footer, pager, etc). Then the problem arose that I need to access the value of the hiddenfield prior to the rows being created, so I had to get the value out of the rows and somewhere else, and I thought creating a new attribute and storing the value there would work. Any suggestions as to how to get around this?
Amanda Myer