Problem with the OnClientClick event


I am trying to assign a javascript function to "OnClientClick" event of the yuiaspnet button.
The problem is that as soon as the page loads the event gets automatically fired without the button even being clicked!
Closed Nov 25, 2008 at 12:41 PM by ra00l


ra00l wrote Aug 19, 2008 at 7:17 AM

Hi shadowsinrain, and thanks for using our controls.

Can you please post the js function & the button's aspx/cs code to try and debug the issue?

ra00l wrote Aug 19, 2008 at 6:37 PM

I just had an ideea. How do you set the parameter?
Is it like: OnClientClick="MyFunction(myParam1, myParam2)"?
You should have OnClientClick="MyFunction", and your function will be called automatically, with 2 params: first, the instance of the client side class, second, an argument from which you can cancel the postback, by setting argument.cancel = true.

Hope this helps

wrote Nov 25, 2008 at 12:41 PM

wrote Feb 13, 2013 at 3:18 AM

wrote May 14, 2013 at 11:13 PM