码迷,mamicode.com
首页 > 其他好文 > 详细

解决showModalDialog和chrome不兼容的其他方法

时间:2017-07-17 09:59:46      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:event   pos   zab   sch   ext   _id   screen   amount   不兼容   

父页面放一个图形按钮和一个TEXTBOX,代码如下:

<asp:TextBox ID="sku_id" runat="server" AutoPostBack="True" onclick="receipt_search_sku_Click" CausesValidation="True"></asp:TextBox>
<asp:ImageButton ID="receipt_search_sku"
OnClientClick="popUp(‘receipt_select_sku.aspx‘)"
runat="server" top="0"
ImageUrl="~/img/search.png" onclick="receipt_search_sku_Click" />

 

<script type="text/javascript">

function popUp(url) {
height = 500;
width = 700;
var paramsChrome = ‘height=‘ + height + ‘, width=‘ + width + ‘, top=‘ + (((window.screen.height - height) / 2) - 50) +
‘,left=‘ + ((window.screen.width - width) / 2) + ‘,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no‘;
objSubWin = window.open(url, "Popup", paramsChrome);
objSubWin.focus();
}

function SetValue(val) {
var amount = document.getElementById(‘<% = sku_id.ClientID %>‘);
amount.value = val;
}

 

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

子页面,放一个gridview读取数据库的内容,当鼠标点击时,返回gridview的元素,同时关闭子页面;

父页面同时接收子页面的返回值;

 

子页面表头放一个函数:

<script type="text/javascript" >
function cc(infor_id) //参数分别为id,name和password
{
if (window.opener != null && !window.opener.closed) {

window.opener.document.getElementById("sku_id").value = infor_id;
window.close();
}
}

</script>

 

后台代码,用GRIDVIEW的鼠标点击事件,去触发该函数

protected void GridView_sku_select_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{

//string w = e.Row.Cells[0].ClientID;
e.Row.Attributes.Add("onclick", "cc(‘" + e.Row.Cells[0].Text + "‘)");
}
}

 

解决showModalDialog和chrome不兼容的其他方法

标签:event   pos   zab   sch   ext   _id   screen   amount   不兼容   

原文地址:http://www.cnblogs.com/adam42/p/7192739.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!