简体   繁体   中英

Calling Jquery file function from code behind page

I have got the following function in the Empdocs.js file

$('.resetButton').click(function () { $('#searchField').val(''); });

How can i call this function from code behind page in VB.Net or C#?

I have tried the following function but it is not working.

ClientScript.RegisterClientScriptBlock(Me.GetType, "resetfunction", "resetButton();", True)

create Reset - function:

function Reset() {
  $('#searchField').val('');
}
$('.resetButton').on("click", Reset);

and from server side you can call

ClientScript.RegisterClientScriptBlock(Me.GetType, "resetfunction", "Reset();", True)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM