不知道出什么问题,帮忙看看
1.aspx
==========
function Selectclass()
{
var myWin;
myWin=window.showModalDialog( "2.aspx ", "dialogWidth=300px;dialogHeight=400px ");
document.getElementById ( "Txtnews_class ").value=myWin;
}
<asp:TextBox ID= "Txtnews_class " runat= "server "> </asp:TextBox>
<input id= "Butselect_class " type= "button " value= "选择栏目 " onclick = "Selectclass() " />
=============
2.aspx
function ss()
{
var a=document.getElementById( "TextBox1 ").value;
window.returnValue=a;
opener=null;
window.close();
}
<asp:TreeView ID= "TreeView1 " runat= "server " OnSelectedNodeChanged= "TreeView1_SelectedNodeChanged " ShowLines= "True " AutoGenerateDataBindings= "false "> </asp:TreeView>
<asp:TextBox ID= "TextBox1 " runat= "server "> </asp:TextBox>
<input id= "Button1 " type= "submit " value= "确定 " onclick = "ss() " />
===========
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
SelectClass bindtree = new SelectClass();
bindtree.bindclass(this.TreeView1);
}
}
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
this.TextBox1.Text = this.TreeView1.SelectedNode.Value;
}
不知哪里出错了,单独运行2.aspx,this.TextBox1可以获得值,但是调试1.aspx,在选择后2.aspx中的this.TextBox1却得不到值,1.aspx中Txtnews_class也获不到值
------解决方案--------------------2.aspx的
<head> </head> 中
有没有 <BASE target= "_self "> ?
没有的话加上