当前位置:编程学习 > C#/ASP.NET >>

asp.net网页和弹出窗口之间如何传递参数

有一个主页面,里面有一个字段的内容是从一个弹出窗口中返回的,填写进去之后,由于网页刷新把刚填写的数据清除了,如何保证网页不刷新 --------------------编程问答-------------------- 使用模态窗口 --------------------编程问答-------------------- 在弹出这个页面并得到值之后,再写下return false;就能保证这个页面不刷新了。。
前提是,触发弹出页面的按钮的click事件,要写成  onclientclick="return javascript事件()"这样。 --------------------编程问答-------------------- 窗口1 var win = window.open() 打开窗口2,得到窗口2的window对象
窗口2用 window.opener得到窗口1的window对象 --------------------编程问答-------------------- var sReturn=window.showModalDialog("" + id,'','dialogWidth:420px;dialogHeight:570px,center=yes,status=no,resizable=no,scroll=no,dialogHide=on');;
  在子页面
function reload()
 {
  window.close();
  }
加入 <base target="_self"/>  

window.opener.document.getElementById("textbox1").value="";

--------------------编程问答-------------------- ChildWindow = window.open ('a.aspx?a=<%=TextBox1.ClientID%>','Win','width=200,height=200,left=250,top=100,menubar=no,toolbars=no,location=no,directories=no,scrollbar=no,status=no,resizable=no');
var txtID = "<%=Request.QueryString["a"]%>";

window.opener.document.getElementById(txtID).value="" --------------------编程问答-------------------- 在你接受参数的页面中放一个HiddenField控件,然后再HiddedField中有个值改变事件,在事件中定义你的操作。这样你的值就不会丢失了。你可以试下。
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,