RegisterClientScriptBlock within AJAX method call

后端 未结 5 1405
长情又很酷
长情又很酷 2020-12-09 12:53

I am trying to RegisterClientScriptBlock in a method that is only called via an AJAX call. It doesn\'t appear to actually register the script on the page and I\'m guessing

5条回答
  •  無奈伤痛
    2020-12-09 13:12

    In general, when loading external javascript after appending an element innerHTML with a block containing such script, one needs to evaluate (eval) the script in order for it to work properly and render itself into the current loaded document.

    I'd suggest doing on of the following:

    Use an external tool such as YUI get utility which is supposed to enable such behavior or do some evaluation for scripts yourself like this

提交回复
热议问题