在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1.使用方法vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures]) 参数说明:
1. dialogHeight: 对话框高度,不小于100px
参数传递:
<script> var obj = new Object(); obj.name="51js"; window.showModalDialog("modal.htm",obj,"dialogWidth=200px;dialogHeight=100px"); </script> modal.htm <script> var obj = window.dialogArguments alert("您传递的参数为:" + obj.name) </script>
-------------------------------
<script>
str
=window.showModalDialog("modal.htm",,"dialogWidth=200px;dialogHeight=100px"); alert(str); </script> modal.htm <script>
window.returnValue
="http://homepage.yesky.com"; </script>
2.C#实例前台JS: function openwindow(url, iWidth, parameter, iHeight) { var iTop = (window.screen.availHeight - 30 - iHeight) / 2; //获得窗口的垂直位置; var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; //获得窗口的水平位置; var ret = window.showModalDialog(url, parameter, 'dialogHeight:' + iHeight + 'px;dialogWidth:' + iWidth + 'px;dialogTop:' + iTop + 'px;dialogLeft:' + iLeft + 'px;status:no;scroll:no;'); if (ret == undefined) { return; } if (ret.DANWMCH != undefined) { document.getElementById("danwmch").value = ret.DANWMCH; } if (ret.DANWBM != undefined) { document.getElementById("ctl00_ContentPlaceHolder1_chumrid").value = ret.DANWBM; } } 前台html“ <a href="#" onclick="javascript:openwindow('DanWSelect.aspx?operate=maishr‘,535,400);" style="color: blue; cursor: hand;">选择</a> 跳转DanWSelect.aspx页面 前台JS: function
setPValue(danWMCh, danWID) { var Select = { 'DANWMCH': danWMCh, //交易商单位名称 'DANWBM': danWID, //交易商单位编码
};
window.returnValue
= Select; window.opener = null; window.open('', '_self'
);
window.close();
}
后台cs:
protected void TPCSDataGrid1_ItemCommand(object source, DataGridCommandEventArgs e) { string jiaoYShBM = e.Item.Cells[0].Text; string jiaoYShMC = e.Item.Cells[1].Text; string operate = Request.QueryString["operate"].ToString(); if (e.CommandName == "Select") //选择赋值 { ScriptManager.RegisterStartupScript(this, this.GetType(), "ss", "setPValue('" + jiaoYShMC + "','" + jiaoYShBM + "');", true); } } |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论