My question is: How do I get the button run my specific C# function after it has validated?
ASP.NETJavaScript.NET ProgrammingC#
Last Comment
Ramkisan Jagtap
8/22/2022 - Mon
Manoj Patil
If OnClickClient has a return value of true then the codebehind OnClick event will fire. If OnClickClient is returned false then it won't.
If OnClickClient doesn't return anything the codebehind event will fire regardless. So you want..
<asp:Button runat="server" ID="btnConfirm" Text="Confirm" OnClick="btnConfirm_Click" /><script language="javascript"> function Validate() { return confirm('Save in db?'); }</script>
If OnClickClient doesn't return anything the codebehind event will fire regardless. So you want..
Open in new window
Open in new window
Above code reference is from below link
http://stackoverflow.com/questions/28760687/invoke-onclientclick-of-button-in-code-behind