Is it possible to fire the onclientclick after the onclick event for asp.net button?
I am sending some values in session from onclick event and then I want to fire onclientclick.
Any help would be advisable.
I believe that can not be happen. But you can use ajax. On client click go to server and write things to session.
- kostas ch.
I mean that can not be happen as you said it, without a trick.
- kostas ch.
It's highly unlikely that this is possible due to the OnClick being a postback that results in a new page, and the OnClientClick being a client side script function. Clearly the script of this page will happen before the result of the postback provides the new page, otherwise the script is no longer there.
- Bazzz
2 Answers
2
votes
You can call the javascript function using register client script inside the onclick of the button.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
OnClickbeing a postback that results in a new page, and theOnClientClickbeing a client side script function. Clearly the script of this page will happen before the result of the postback provides the new page, otherwise the script is no longer there. - Bazzz