Go homepage(回首页) Upload pictures (上传图片) Write articles (发文字帖)
The author:(作者)delvpublished in(发表于) 2014/1/6 9:12:14 实现在页面中单击按钮关闭页面_[Asp.Net教程]
this.btnClose.Attributes.Add("onclick","window.close()");//btnClose是按钮的名字
此语句是给其添加一个单击属性,调用window.close()方法。
2> 在html页面中要实现单击一个按钮(html控件)来关闭当前页面,只需要在html代码中的按钮控件代码中添加一个onclick属性即可,代码如下:
< INPUT id="Button1" type="button" value="Button" name="Button1" onclick="window.close>
来源:网络
赞