各位高手.
    我的环境是vs2008\c#,DB是SQL2000.我在WEB控件BUTTON的CLICK事件中写入Response.Write("<script language=javascrip> alert('hello');</script>");时总是执行不了,请教了身边的高手也不知道是什么原因。请各位帮忙。

解决方案 »

  1.   

    Response.Write(" <script language='javascript'> alert('hello'); </script>");
    javascrip=== javascript
      

  2.   

    Response.Write("<script language='javascript'> alert('hello'); </script>");
    就行
      

  3.   

    应该为 javascript 而不是你写的javascrip
      

  4.   

    Response.Write(" <script> window.alert('hello'); </script>"); 
    我一般这么写
      

  5.   

    Response.Write(" <script> window.alert('hello'); </script>"); 
    我一般这么写
      

  6.   

    我也这么写
    Response.Write(" <script> window.alert('hello'); </script>"); 
    但也不行,很奇怪的.我在我自己的私人电脑中是可以的.但就是在工作的电脑上就不行.
      

  7.   

    别直接Response吧,习惯不好,用RegisterScript 注册一段javascript在页面上吧
      

  8.   

    还有个问题 language 这个属性已经被抛弃了  用type="text/javascript"不知道是不是这个问题造成的。
      

  9.   


    Response.Write("<script>alert('HELLO');</script>");
      

  10.   

    [本命大限在田宅宫化忌] 大佬,你说的对,如果我把其放在UpdatePanel之外的,他就可以了,但我想问一下,他不能放在UpdatePanel里面吗????
      

  11.   

    我意思是你javascrip拼错了.呵呵UpdatePanel中这样用 page.ClientScript.RegisterStartupScript(page.GetType(), "ShowMessage", "alert('hello');", true);
      

  12.   

    在UpdatePanel中要这么写:ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "alert('hello');", true);
      

  13.   

    感谢各位,问题得到解决.我是asp.net的新手,以后望多多指教.