views:

27

answers:

1

I am still relatively new at VB.Net and Visual Studio and I'm assuming that this is a simple fix, but I'm not sure.

I have an asp:checkbox control on an aspx page I am working on. This checkbox is within a custom control and previously was posting back every time it was clicked. I am in the process of ajaxifying the page and have come across a problem. When I remove the attribute AutoPostBack="True" from the asp:checkbox, the vb code returns False when I check myCheckbox.checked (this is on a postback else where on the page what has not be ajaxified), even though I can see the box is indeed checked.

I am assuming that because the checkbox no longer posts back, for some reason the VB code (or the view state maybe) doesn't see it as having been checked. Is this correct, and if so, how to I correct it?

A: 

I am assuming that because the checkbox no longer posts back, for some reason the VB code (or the view state maybe) doesn't see it as having been checked.

This is correct, your toggling of the checkbox is happening only on the client side, so your server side is unaware of the change.

NTW
-1 This is not correct. When the PostBack is generated, the value of the checkbox's Checked property should be true.
Joel Etherton