在Form_Load事件里加这段代码试试:
Button2.Attributes.Add("onclick","return confirm('是否进行下去!');")

解决方案 »

  1.   

    表明用哪種語言language=javascript
      

  2.   

    因为Response.Write是写在一个html头的,此时文档里没有任何控件,所以document.getElementById('Button2')就会找不到对象,用strawwan(稻草人) 的方法可以实现你的需求,也可以
    Page.RegisterStartupScript("("<Script>if(window.confirm('是否进行下去!')");
      

  3.   

    那中方法是 可以
    我这样是在Button1中写那个Response.write()
    我的意思通过弹出窗口来触发Button2的click事件
      

  4.   

    Button2.Attributes.Add("onclick","return confirm('是否进行下去!');")