NET 弹出页面窗口选择返回值

  在对话框要显示的页面中<head></head>标签内加入“ <base target="_self" /> ”。

  处理回发弹出新页面的问题

  主要功能描述:

  在网页中 点击一个按钮 弹出一个页面窗口,选择弹出页面窗口的值,关闭窗口,界面得到值

  

复制代码 代码如下:

  //对B界面选择值处理

  <input type="button" id="btnClose" value="确认并关闭窗口" onclick="closeWin()" />

  function closeWin() {

  //把B界面的值传到A界面去

  window.returnValue = totalCount;

  window.close();

  }

  //A界面需要选择值

  function showUnitDialog2(id) {

  var rdm = Math.random();

  //打开B界面

  var result = window.showModalDialog("GoodsStocketacke.aspx?id=" + id + "&t=" + rdm, "盘点明细", "dialogWidth=800px;dialogHeight=500px;center=1");

  //接受B界面的值

  if (result) {

  $("#txtRealCount").val(result);

  $("#txtRealCount").attr("readonly", "true");

  $("#tbUnit tr:eq(1) td:eq(3)").html(result);

  initButton();

  }

  }