I'm using a Gridview, the first column are checkboxes.
The Gridview uses paging and sorting.
The checkboxes are inside of a UpdatePanel because I'm using the CheckedChanged event when a checkbox is checked (don't want to use a full postback).
Everytime a checkbox is checked, in codebehind I enable a button for compare items if is needed, save that that checkbox was checked in viewstate and check if the selected items didn't reach the maximum. If the max items are reached, i disable the rest of the unchecked checkboxes (the max items are a restriction to avoid a user to select more items that can't be displayed in the page layout).
This works great, except for example when you go to page 2, and then hit the back button of the browser.
When you hit the back button, all the checkboxes that were disabled, appears enabled and the user can select more that the max.
If I don't use an updatepanel for the checkboxes, it works great, it remembers the checkboxes disabled, but I don't want to do a full postback everytime a checkbox is checked.
Is there any way I can solve this?
Many thanks