CheckBox Control

niros

Newcomer
Joined
May 25, 2004
Messages
23
Hi,
when I am using the asp:CheckBox control and I try to catch the CheckedChanged event it doesn't catch it.
when I write something in it adding a break point and debuging it it never gets there.

some one have an idea?
thanks.
 
PlausiblyDamp said:
You will only get the event on a page postback, either put a button on the form as well or set the checkbox's AutoPostBack property to true.

Thanks it worked.
what the autopost back is actually doing?
 
Using ASP the code behind the control events only runs on the server not the client browser (if you need to handle things at the client level then a client side script would need to be written - normally in javascript).
For the server side code to run the page needs to be submitted to the server, the server code runs and then a new page is sent down to the browser - this is a post back. Post backs can be expensive in terms of bandwith and time (especially if the client has a slow connection) and should be kept to a minimum, so by default only buttons cause this client->server->client round trip to occur.
Auto postback just causes this to happen for controls other than buttons.
 
Back
Top