=====================================前台代码
<input type="button" onclick ="aa();" value="点击" /> <script type="text/javascript"> function aa() { var bu = document.getElementById("Button1"); bu.click(); } </script> <asp:Button ID="Button1" runat ="server" OnClick ="button1_click" />
=====================================后台代码
protected void button1_click(object sender, EventArgs e) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert(‘对不起,没有此人!!!‘)</script>"); }
访问修饰符是protected 或public
本文出自 “程序猿的家” 博客,请务必保留此出处http://962410314.blog.51cto.com/7563109/1384183