calling javascript from server side
How开发者_高级运维 to call javascript function from server side
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.
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.
精彩评论