Click here to Skip to main content
15,897,147 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
The Situation:

I use document.ready() to get booleans trough ajax / json inside a repeater for a series of dynamic checkboxes.
these checkboxes are the standard <asp:CheckBox /> controls.

I use this method because the runtime of a check of the Booleans can take a few seconds.

All this works just fine.
the problem:

if the json answer is true, and I set the checkbox value to 'checked' if I then click the checkbox, the checkbox changes to unchecked, but no postback accurs.

so:
pageload: checkbox is set after asp processing to true.
click 1: checkbox is unchecked, no postback
click 2: checkbox is checked, postback occurs, but value was already true.
click 3: checkbox is unchecked, postback, everything works.
click 4: checked, postback, no problems.


if the initial value turns out to be unchecked, then everything works right from the first click.

my best guess is that asp doesn't realize the first click that the value is changed because as far as it knows, is was already unchecked.


I hope all this makes any sense, I tried my best to explain but my English isn't that good.

thanks in advance!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900