通过js实现父窗体弹出子窗体,弹出后子窗体返回值给父窗体。我将值传递给一个隐藏的textbox后,刷新页面,textbox里的值就被清空了,有什么办法保留住子窗体传过来的值吗?因为我想在后台(xxx.aspx.cs页面里使用这个值)。
以下是js代码:
父窗口:
function Select()
{
var Id;
//弹出子窗口
Id=window.showModalDialog("aaa.aspx");
document.all["hiddentext"].value=Id;
//alert(document.all["hiddentext"].value);
//刷新父窗体
window.location.reload();
}
子窗体aaa.aspx
function returnID(id)
{
//alert(id);
window.returnValue = id;
window.close();
}
以下是js代码:
父窗口:
function Select()
{
var Id;
//弹出子窗口
Id=window.showModalDialog("aaa.aspx");
document.all["hiddentext"].value=Id;
//alert(document.all["hiddentext"].value);
//刷新父窗体
window.location.reload();
}
子窗体aaa.aspx
function returnID(id)
{
//alert(id);
window.returnValue = id;
window.close();
}
在前台怎么存放到Session里啊??to czy412(我想飞!但我没翅膀,唉!)
是啊,reload()之前值是存在的。但是我刷新后,值就变成空了。
我现在的问题就是如何在刷新页面后还能保存住这个值,并把这个值传到后台?