views:

380

answers:

2

I have an asp:checkbox control, and I want to change the visibility of a Label when it is checked or unchecked. To do this I'm attempting to use the OnCheckChanged event, which apparently only fires after a post to the server. This means that my Label's visibility isn't changing immediately. How do I post to the server (and preserve the state of my form) so that when the checkbox is clicked the Label's visibility immediately toggles?

A: 

Well, do you need the checkbox control to post to the server when is clicked?

if the answer is no, then you could use an html input control and use javascript to handle the onclick event. This way the action would be immediate and you save a post back to the server.

Victor
A: 

Set AutoPostBack = true for the check box.

CountCet