1、UpdatePanel 使用中

protected void Button1_Click(object sender, EventArgs e)
{
this.Label1.Text = "测试时间:" + DateTime.Now.ToString();

ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(),"testalert", "<script>Test();</script>", false);
}

2、UpdatePanel 没有使用

protected void Button1_Click(object sender, EventArgs e)
{
    this.Label1.Text = "测试时间:" + DateTime.Now.ToString();
    ClientScriptManager cs = this.ClientScript;
    cs.RegisterStartupScript(this.GetType(), "HelloWorld", "<script>alert('test alert');</script>");
}

 

源代码下载:https://files.cnblogs.com/tianjinquan/WebReportJS.zip

  

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-02
  • 2022-01-14
  • 2022-01-11
猜你喜欢
  • 2021-12-20
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-10
相关资源
相似解决方案