日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

关于showModalDialog 的常见问题

發布時間:2023/12/15 综合教程 25 生活家
生活随笔 收集整理的這篇文章主要介紹了 关于showModalDialog 的常见问题 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

在我們的實際開發中,經常會用到showModalDialog 模態窗體,對于其中的問題有時候真是讓人頭痛,在此我寫一點自己在開發中遇到的問題以及解決辦法。

一、刷新問題
第一種情況是:模態窗體的父窗體不刷新問題,就是在關閉模態窗口后,父窗體不刷新。
解決方法:在你的彈出模態窗體的JavaScript后面寫上window.location.reload();

第二種情況是:有時候不想讓父窗體刷新,也就是在關閉模態窗口后,讓父窗體不刷新
解決方法:在你的彈出模態窗體的JavaScript后面寫上return false;
二、關閉問題
關閉方法:使用JavaScript
window.opener=null;self.close();

三、傳遞對象

1protectedvoidbtnOK_Click(objectsender,EventArgse)
2{
3System.Text.StringBuildersb=newSystem.Text.StringBuilder();
4sb.Append("<scriptlanguage=\"javascript\">");
5stringstrReturnText=string.Empty;
6stringstrReturnValue=string.Empty;
7if(Request.Form["rbtnSelect"]!=null)
8{
9strReturnText=Request.Form["rbtnSelect"].ToString();
10strReturnValue=Request.Form["rbtnSelect"].ToString();
11//Response.Write(strReturnText);
12}
13if(rdo_NewLocation.Checked==true)
14{
15//strReturnText=Request.Form["rbtnSelect"].ToString();
16//strReturnValue=Request.Form["rbtnSelect"].ToString();
17
18sb.Append("varret=newObject();");
19sb.Append("ret.txt_BuildingName='"+txt_BuildingName.Text+"';");
20sb.Append("ret.txt_Unit='"+txt_Unit.Text+"';");
21sb.Append("ret.txt_Floor='"+txt_Floor.Text+"';");
22sb.Append("ret.txt_StreetNo='"+txt_StreetNo.Text+"';");
23sb.Append("ret.txt_Street='"+txt_Street.Text+"';");
24sb.Append("ret.txt_District='"+txt_District.Text+"';");
25sb.Append("ret.txt_City='"+txt_City.Text+"';");
26sb.Append("ret.txt_Country='"+txt_Country.Text+"';");
27
28}
29
30//sb.Append("window.returnValue='"+strReturnText+"|"+strReturnValue+"';");
31sb.Append("window.returnValue=ret;");
32sb.Append("window.close();");
33sb.Append("</script>");
34Response.Write(sb.ToString());
35}
36父頁面接收
<scriptlanguage="JavaScript"type="text/javascript">

functionRelocationSelect()
{
varret=window.showModalDialog("../Common/RelocationSelection.aspx",'','dialogWidth:630px;dialogHeight:300px;');
if(ret!=undefined)
{

document.getElementById("txt_BuildingName").value=ret.txt_BuildingName;
document.getElementById("txt_Unit").value=ret.txt_Unit;
document.getElementById("txt_Floor").value=ret.txt_Floor;
document.getElementById("txt_StreetNo").value=ret.txt_StreetNo;
document.getElementById("txt_Street").value=ret.txt_Street;
document.getElementById("txt_District").value=ret.txt_District;
document.getElementById("txt_City").value=ret.txt_City;
document.getElementById("txt_Country").value=ret.txt_Country;

}
returnfalse;
}
</script>

總結

以上是生活随笔為你收集整理的关于showModalDialog 的常见问题的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。