window.showModalDialog返回两个值的问题。。。
function openry()
{
var someValue=window.showModalDialog( "Jigou.aspx ")
document.form1.TextBox6.value=someValue;
}
Jigou.aspx:代码
protected void CategoryView_SelectedNodeChanged(object sender, EventArgs e)
{
string mc,id;
mc = CategoryView.SelectedNode.Text.ToString();
id = CategoryView.SelectedNode.Value.ToString();
Response.Write( " <script> window.returnValue= ' "+mc+ " '; window.close(); </script> ");
}
使用window.showModalDialog打开一个新窗口,单击新窗口里TreeView ID= "CategoryView " 中的一项,返回对应的mc和id,上面的写法只能返回一个值。。。那高手帮看看,怎么写才能返回两个值
------解决方案--------------------function openry()
{
var someValue=window.showModalDialog( "Jigou.aspx ")
var ary = someValue.split( "| ");
var mc = ary[0];
var id = ary[1];
//document.form1.TextBox6.value=someValue;
}
Jigou.aspx:代码
protected void CategoryView_SelectedNodeChanged(object sender, EventArgs e)
{
string mc,id;
mc = CategoryView.SelectedNode.Text.ToString();
id = CategoryView.SelectedNode.Value.ToString();
string s = mc+ "| "+id;
Response.Write( " <script> window.returnValue= ' "+s+ " '; window.close(); </script> ");
}