Live Chat Icon For mobile
Live Chat Icon

How can the a client side function be called on a button click event?

Platform: ASP.NET| Category: Client Side Scripting

In 2.0 Button control has a property OnClientClick which is used to call a client side function before postback.

<asp:Button ID='Button1' runat='server' Text='Button'  OnClientClick='ClientFunction()'/>
<script>
	functionClientFunction()
	{
		alert('ClientFunctionCalled');
	}
</script>

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.