在AJAX中,因为我们使用了ScriptManager.因此,不能直接使用Response.write js。

  但ScriptManager提供了一个RegisterClientScriptBlock 可以让我们来用。

     使用如下 :

          string strJS = " alert('谢谢你的参与!'); ";
        System.Web.UI.ScriptManager.RegisterClientScriptBlock (this.btnGrade, this.btnGrade.GetType(), "ajs", strJS, true);

 

  其中的btnGrade是引发JS的一个按钮。

相关文章:

  • 2021-07-11
  • 2021-09-18
  • 2021-05-18
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-27
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
相关资源
相似解决方案