A页面上有个文本框和一个按钮,点击按钮出现B页面,
B页面上具体的实现查询的功能,怎么将B页面上查询结果(某条记录)返回到A页面上的文本框内?
不考虑刷新不刷新的问题,方面的给个伪代码,急切等待,谢谢
B页面上具体的实现查询的功能,怎么将B页面上查询结果(某条记录)返回到A页面上的文本框内?
不考虑刷新不刷新的问题,方面的给个伪代码,急切等待,谢谢
解决方案 »
- 前端展现?
- 手动配置ASP.NET2.0
- 100分求解owc10发布到服务器后图表不显示的问题!!
- 我想再page_oninit事件中 用线程实现异步加载,顶者有分!
- DataGrid超链列能否显示的内容为实际超链地址的一部分?
- 关于排考系统的问题,求助,100分
- 水晶报表10的web打印为何没有反应?
- 请问在网页中如何用这个函数
- 请教大家:怎么样才能从数据库里把部门字段的一个值显示到TEXTBOX里?我的代码如下:
- 怎样在asp.net中实现数据的动态查询?
- **所有分请教简单问题** DropDownList在绑定情况下怎么给第一行设置为Null
- treeview的node有onclick事件吗
function ReturnValue(ReturnParam)
{
window.returnValue=ReturnParam;
window.close();
}
后台给每一行加上
DataGrid2.Items[i].Attributes.Add("onclick","ReturnValue('"+ReturnParam+"')");
string tmp = "abc";
Response.Write("<script>opener.document.getElementById('TextBox1').value='"+tmp+"'; </script>";
在b写一个脚本调用A页脚本 opener.aa(arr) arr就是你将在a显示的在b查到的结果
string tmp = "abc";
Response.Write("<script>parent.document.getElementById('TextBox1').value='"+tmp+"'; </script>";
function AddChecked()
{
window.opener.document.forms[0].txtSendToID.value = selectUserID;
window.close();
}
var rt = openDialog(B.ASPX,'',620,400,'status:no;help:no');
if (typeof(rt) != 'undefined')
{
rt//B.ASPX的返回值
}
B页面查询结果这样返回:Page.RegisterStartupScript("success","<script language=javascript> window.returnValue = '"+returnvalue+"'; alert('查询成功')</script>");
第一个页面:Button1,TextBox1
事件:
(1)page_load
if (Page.PreviousPage != null)
{
TextBox t = (TextBox)PreviousPage.FindControl("TextBox1");
if (t != null)
{
TextBox1.Text = t.Text;
}
else
{
Response.Write("Error");
}
}(2)Button1事件:Response.Redirect("default4.aspx");第二个页面:BUtton1,TextBox1
设置Button1的PostBackUrl为第一个页面这样就可以将第二个页面的TextBox1的值传过去不知道是不是lz想要的
可以通过window.returnValue向打开对话框的窗口返回信息,当然也可以是对象。例如: test4.htm
===================
<script>
var a = window.showModalDialog("test5.htm")
for(i=0;i<a.length;i++) alert(a[i])
</script> test5.htm
===================
<script>
function sendTo()
{
var a=new Array("a","b")
window.returnValue = a
window.close()
}
</script>
<body>
<form>
<input value="返回" type=button onclick="sendTo()">
</form>
--把隐藏哉设为runat="server",在load事件中加载查询到的内容
window.open ....b
window.opener.textbox.value=..;
window.close();
<script language="javascript">
<!--
function openwin2()
{
var a=window.showModalDialog('b.aspx',window,'dialogWidth:300px;dialogHeight:180px;center:yes;help:no;resizable:no;status:no');
if(a!=null)
{
document.all.textbox1.value=a;
}
}
-->
</script>再再B.aspx的代码里的选择记录事件里添加如下:
Page.RegisterStartupScript("","<script language='javascript'>var a= new Array('"+/*选定或查询出的值*/+"');window.returnValue=a;window.close();</script>");