Below is my scenario:
Scenario:
1. I have one telerik:RadAjaxManager which has telerik:AjaxSettings. In it, AjaxControlID is a button Id and AjaxUpdatedControl is a table which contains that button along with few textboxes, requiredfieldvalidators for them and one server side button.
2. The button has onclientclick and onclick events registered.
3. Onclientclick event calls a simple javascript function which does some validation of form data and returns true or false. (OnClientClick="return ValidatePage();")
4. Onclick event calls some server side implementation.
Behavior:
1. When a button is clicked, requiredfieldvalidators (only checks if data is entered) gets fired.
2. When data is entered in the textboxes, javascript function 'ValidatePage()' (checks if VALID data is entered) gets fired.
3. When ValidatePage() returns false, server side event doesn't get fired.(Which is desired behavior)
4. When ValidatePage() returns true, still server side event doesn't get fired.(Which is not desired behavior)
5. When OnclientClick event registration is removed, the server side event gets fired through AJAX after entering data in the textboxes.
6. When button is moved out of the table, both, the javascript function and the server side event gets fired but normal postback occurs.
Desired behavior:
1. First requiredfieldvalidators should get fired.
2. Then 'ValidatePage()' should get fired. If it returns false, it should restrict server side call. If it returns true, server side event should get called through AJAX.
Please let me know if you have any comments on it.
Regards,
Shubha