在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.VEVb.com/archive/2006/05/29/412209.html
新聞熱點
疑難解答