Answers

Question and Answer:

  Home  JQuery Developer

⟩ If you have a server control(asp.net server control, Button) and on the click of button you want to call a jquery function, So tell me how you will call a jquery function without postback?

ASP.NET provides the OnClientClick property to handle button clicks. You can use this property on Button, LinkButton and ImageButton. The same OnClientClick property also allows you to cancel a postback.

So I can use OnClientClick property and Jquery function will return false.

Example:

Code:

<script type="text/javascript">

function callMe()

{

alert('Hello');

return false;

}

</script>

<asp:Button ID="Button1" runat="server" OnClientClick="return callMe();" Text="Button" />

 155 views

More Questions for you: