求救!!!请问各位遇到过这种情况没有?
if (txtSeachYear.Text == "")
 {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('年份不能为空')", true);
                
}在本地服务器测试完全可以弹出提示信息,但是传到服务器上以后,就没反应,服务器是windows 2000系统

解决方案 »

  1.   

    if (string.IsNullOrEmpty(txtSeachYear.Text))
     {
      ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('年份不能为空');", true);
        
    }
      

  2.   

    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('年份不能为空')", true);
    之前是不是有一个没有名称的执行了?就是第3个参数为空的ScriptManager.RegisterStartupScript
      

  3.   

    好像遇到过类似的问题!
    改成false试试,如:
    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "<script>alert('年份不能为空')</script>", false);
      

  4.   

    alert()前后加上<script>、</script>
      

  5.   

    好像遇到过类似的问题!
    改成false试试,如:
    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "<script>alert('年份不能为空')</script>", false);
    这种方式也试了,本地行,一旦传到服务器上,还是不行,没反应,任何信息不提示
      

  6.   

    终于解决问题了,郁闷的很,指定了一个UpdatePanel就对了,造孽
      

  7.   

     ScriptManager.RegisterStartupScript(this, this.GetType(), "", "alert('年份不能为空');", true);