webform button

https://www.codeproject.com/Questions/412553/differences-between-onClick-and-onClientClick

OnClick will work on server side , OnClientClick will execute on client side before control passed to server.
If the client side code returns TRUE then it will go to server.
Generally programmers use onClientClick to validate the controls like textbox,etc.
The Button/LinkButton/ImageButton controls in asp.net 2.0 and more have a OnClientClick property. This is basically a shortcut for Attributes["onclick"] allowing you to do:

 

https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.button.onclientclick?view=netframework-4.7.2

https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.button.onclick?view=netframework-4.7.2

https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.button.click?view=netframework-4.7.2

 

posted @ 2019-02-14 15:36  ChuckLu  阅读(421)  评论(0编辑  收藏  举报