tags:

views:

563

answers:

3

I have a aspx page that contain "asp:RequiredFieldValidator" controls;Problem that is when each of "asp:RequiredFieldValidator" controls activate and show their messages; other controls in my page don't working even "CANCEL" button!!! i want to enable controls in my "NEXT" button MouseDown and then disable them at my "NEXT" button MouseUp. Thanks for any other solutions...

+1  A: 

Specifically to answer your question as stated in your title: to add additional event handlers to an asp:button or other server controls that are not composite you simply add the handler to the element. Include onmousedown="myMouseDownHandler(this);" in the element and the javascript function myMouseDownHandler will fire.

However, I think there is a better way to do what your asking but the description of the question is not coherent enough for me to quite figure out what you're asking. I realize you may not be a native English speaker but perhaps you could give it another pass.

Peter Oehlert
A: 

Use ValidationGroup property on controls that are validated and controls that triggers validation (e.g. save/update buttons) and on validators.
Additionally set CausesValidation property to false on each button that does not need to trigger validation (cancel button).

Aleksandar
A: 

Thanks;i get it :)