首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

哪位高手能帮小弟我看一上!返回值为空,咋回事啊

2012-08-09 
谁能帮我看一下!!急!急!急!急!急!返回值为空,怎么回事啊?我在一个页面里面这么写的:JScript codefunction

谁能帮我看一下!!急!急!急!急!急!返回值为空,怎么回事啊?
我在一个页面里面这么写的:

JScript code
function dealSelectAccount(sender) {        var result = window.showModalDialog("ProjectTypeList.aspx", "", "dialogWidth:540px;dialogHeight:255px;dialogLeft:300px;dialogTop:250px;center:yes;help=no;resizable:no;status:no;scroll=yes");        alert(result);


然后我在新打开的页面里面这么写的:

C# code
protected void btn1_Click(object sender, EventArgs e)        {            for (int i = 0; i < this.treeList.Nodes.Count;i++ )            {                if(treeList.CheckedNodes[i].Checked==true)                {                    Session["ID"] = treeList.CheckedNodes[i].Value.ToString();                    Session["NAME"] = treeList.CheckedNodes[i].Text.ToString();                    string tmp = Session["NAME"].ToString();                    Response.Write(" <Script language='JavaScript'> window.opener=null;window.open('about:blank','_self');window.returnValue = '" + Session["NAME"].ToString() + "';window.close();</Script>");                    break;                }            }         }


问题在于alert(result);为空,怎么回事啊?


[解决办法]
window.opener=null;window.open('about:blank','_self');

写这些无用的代码多此一举
[解决办法]
C# code
页面B:点击B上的(html)img执行function RetrunVal()function RetrunVal(){    var obj = window.dialogArguments;                   obj.value1=document.form1.ddlB.value;                   window.returnValue = obj;                   window.close();}页面A:在页面A加入TextBox1function OpenDialog(Url){  var t1;var obj=showModalDialog(url,window,"dialogHeight:200px;dialogWidth:500px"); if(obj != undefined)          {              t1= obj.value1;              eval("form1.TextBox1.value='"+TextBox1Name+"'");              eval("form1.TextBox1.blur()");          }} 

热点排行