janes

1. Response.Write(“<script>alert(‘保存成功’);</script>”);

    这种方式挺简单的,就是经常执行后页面上的字体都变形了。悲伤

2. Page.RegisterStartupScript("js", "<script>alert(‘保存成功’);</script>");

    这种方法倒是可以正常弹出了。不过该方法已经基本过时了,推荐的方法是使用ClientScriptManager 类的 RegisterStartupScript 方法。

3.使用了UpdatePanel,弹出对话框。

   上面的方法在使用Updatepanel时又失灵了,我们改用下面的方法:微笑

ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, this.UpdatePanel1.GetType(), "alert", " <script> window.alert(\'保存成功!\'); </script> ", false);

分类:

技术点:

相关文章:

  • 2021-11-01
  • 2021-12-01
  • 2021-11-30
  • 2021-11-17
  • 2021-09-20
  • 2021-09-27
  • 2021-07-01
  • 2022-01-14
猜你喜欢
  • 2021-09-19
  • 2021-12-25
  • 2021-06-28
  • 2021-12-01
  • 2021-11-23
  • 2021-11-02
  • 2021-11-06
相关资源
相似解决方案