当前位置:首页 > 网络编程 > WEB编程 > ASP.net >  实现在页面中单击按钮关闭页面

 实现在页面中单击按钮关闭页面

点击次数:40 次 发布日期:2008-11-26 11:21:46 作者:源代码网
源代码网推荐      在aspx页面中要实现单击一个按钮(服务器端控件)来关闭当前页面,只需要在aspx页面的page_load()方法中加入下列语句:
源代码网推荐  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
源代码网推荐  
源代码网推荐  http://lj821022.cnblogs.com/archive/2006/05/29/412209.html
源代码网推荐  
源代码网推荐    做人要厚道,请注明转自酷网动力(www.ASPCOOL.COM)。
源代码网推荐


源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华