窗口传值问题,多个参数!
在a页面中点击textbox弹出b窗口,b窗口中有一棵树,点击树,把selectNode的text和value传给a中的两个textbox!
------解决方案--------------------可以使用javascript实现
b窗口的window.opener就代表a
然后使用window.opener.document.getElementsById( "id ")= "xxx "来赋值
------解决方案--------------------两个窗口父子关系,在javascript中使用window对象很容易实现..
------解决方案--------------------参考
http://blog.csdn.net/cpp2017/archive/2007/02/27/1515474.aspx
------解决方案--------------------最常规的做法是用session
定义一个类class MyTree,包含两个属性text和value
B窗口:
MyTree myTree = new MyTree();
myTree.Text = " ";
myTree.Value = " ";
Session[ "MyTree "] = myTree;
A窗口:
MyTree myTree = new MyTree();
myTree = (MyTree)Session[ "MyTree "];
------解决方案--------------------class MyTree的定义:
using System;
using System.Collections.Generic;
using System.Text;
namespace test
{
/// <summary>
///
/// </summary>
public class MyTree
{
private String _text;
private String _value;
//Text属性
public String Text
{
get
{
return _text;
}
set
{
_text= value;
}
}
//Value属性
public String Value
{
get
{
return _value;
}
set
{
_value= value;
}
}
}
}