开发者

calling javascript from server side

开发者 https://www.devze.com 2023-01-05 19:48 出处:网络
How开发者_高级运维 to call javascript function from server sideYou can simply do a Response.Write(\"<script language=\'javascript\'>nameOfJavascriptFunction();</script>\"), or use ClientSc

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号