Executing JavaScript from the server code in asp.net

284 Views Asked by At

Here is what I need to do: I need to execute some server side code after a user clicks on a button, THEN I need to execute some client side code. OnClientClick gets invoked BEFORE the onClick; and what I need is the opposite.

Is there a way to do this? It looks like I will have to execute JS code from the server code.

1

There are 1 best solutions below

0
On BEST ANSWER

You could use RegisterStartupScript in the code behind of your app.

This would place the javascript code you need to be called in the body.onload event.