// ScriptManager.RegisterStartupScript(UpdatePanel1, typeof(UpdatePanel), "scriptname", "<script>alert('2');</script>", false);
ScriptManager.RegisterStartupScript(UpdatePanel1, typeof(UpdatePanel), "scriptname", "alert('2');",true);
ajax的button的click中不能用response.write("<script>alert('1');</script>");而用以上两种,true是不带脚本的,false带脚本的