asp.net 子窗體應用
主窗體彈出子窗體代碼
string s="<script language='javascript'>window.showModalDialog('WebForm2.aspx',window,'dialogwidth:150;dialoghigth:100px;help:no');window.location.href=window.location.href;</script>";
if(!this.IsStartupScriptRegistered("starup"))
{
this.RegisterStartupScript("starup",s);
}
子窗體<head></head>中加入<base target=_self>,
關閉子窗體
Button1.Attributes.Add("onclick","javascript:window.opener=null;window.close();");
還沒寫完,買東西回來再寫!!!!!!!!!!
紅色部分實現子窗體關閉後主窗體自動刷新。