You can't call JS from the C# since the C# code runs on the server side, until the HTML is prepared by the server to go to the client side.
Inside the HTML that goes to the client side there are your Javascript functions.
What you CAN do is set code to execute on the onClick event of the button on the HTML and thus execute code on the client side before the page does a postBack to the server.
Hers's an example of using the onclick event of a button in Javascript:
<button onclick="myFunction()">Click me</button>
Cheers,
Edo