Response.Write ("<script language=javascript>alert('大家好')</script>");

解决方案 »

  1.   

    能btn.attribute["onclick"]="javascript:alert('hello world');";
      

  2.   

    btn.attribute.add("onclick","alert('大家好');");
      

  3.   

    void Page_Load(object sender,EventArgs e)
    {
        btn.attribute["onclick"]="javascript:alert('hello world');";
    }
      

  4.   

    btn.attribute["onclick"]="javascript:alert('hello world');";
      

  5.   

    //btn
    onclick = "functionName"
    functionName
    {
    "<script language=javascript>alert('大家好')</script>";
    }
      

  6.   

    this.RegisterClientScript("xxx","<script>alert('胡主席是好主席!!');</script>");
      

  7.   

    最佳的方法:
    page.RegisterStartupScript("","<script>alert('大家好!');</script>");
      

  8.   

    放在page_load事件中
    Button.attribute["onclick"]="javascript:alert('hello world');";
      

  9.   

    可以:
    http://www.aspxcontrol.com/download/WebMessageBox.zip