Server side javascript call

How to call javascript function from server side

+3
source share
2 answers

You can just do Response.Write("<script language='javascript'>nameOfJavascriptFunction();</script>")or use ClientScriptManager.RegisterClientScriptBlockwith a similar script.

The effect is that you write out a script tag that calls your function - the call is still being made on the client side.

+5
source

How about the client side polling the server for actions? Make a server-side call to check for a specific state, and if that state is running, call the function? It should be easily achieved.

0
source

Source: https://habr.com/ru/post/1752964/


All Articles