Hi John,
Thank you for writing back.
When there is Ajax enabled for the Button control doPostback event handler is automatically added to the OnClientClick event. If you inspect the rendered html of the page you would see this for the Button:
The doPostback function is called after foo() regardless of the returned result. In order to work around this you could use a condition in the client-side event that returns false explicitly. The definition for the button would look like so:
The rendered code for the Button would look like below:
This time when a value is returned the doPostback() function will not be called.
I am attaching a sample project illustrating this approach. Give this approach a try and you should have no problems.
Regards,
Viktor Tachev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the
blog feed now.