第一种 //为Button1添加onclick()事件 Button1.Attributes.Add("onclick", "checkSame()"); 第二种 //后台调用前台JS函数 show()为前台的js方法 ScriptManager.RegisterStartupScript(Page, this.GetType(), "onclick", "show();", true); //第三种,GiveValue()为JS函数 ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "GiveValue();", true); 考虑用法:可以后台某种情况下,执行前台的js函数,例如弹出一个层,层上面设有两个Button,让用户去选择操作,从而执行相应的事件