Reputation: 4040
How to call javascript function from server side
Upvotes: 3
Views: 5252
Reputation: 499352
You can simply do a Response.Write("<script language='javascript'>nameOfJavascriptFunction();</script>")
, or use ClientScriptManager.RegisterClientScriptBlock
with a similar script.
The effect is that you are outputting a script tag calling your function - the call is still done on the client side.
Upvotes: 5
Reputation: 7230
How about having the client side polling the server for actions instead? Do a call to the server side to check for a certain state, and if that state is fulfilled call the function? Should be easily achieved.
Upvotes: 0