All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
实现在页面中单击按钮关闭页面_[Asp.Net教程]

Writer: delv Article type: Programming skills(编程技巧) Time: 2014/1/6 9:12:14 Browse times: 426 Comment times: 0

实现在页面中单击按钮关闭页面_[Asp.Net教程]


Head photo

Go homepage
Upload pictures
Write articles

实现在页面中单击按钮关闭页面_[Asp.Net教程] 在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>

来源:网络





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.