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

一个向父窗体传值的简单有关问题

2012-02-03 
一个向父窗体传值的简单问题Response.Write( scriptlanguagejavascript)Response.Write( window.op

一个向父窗体传值的简单问题
Response.Write( " <script   language=javascript> ")
                Response.Write( "window.opener.document.Form1.Image1.ImageUrl= ' "   &   FileUrl.ToString()   &   " '; ")
                Response.Write( "window.opener.document.Form1.TextBox18.Text= ' "   &   FileUrl.ToString()   &   " '; ")
                Response.Write( "window.opener.document.Form1.TextBox18.value= ' "   &   FileUrl.ToString()   &   " '; ")
                Response.Write( "window.close(); ")
                Response.Write( " </script> ")

我是这样写的.在这个代码后父窗体中的TextBox18可以得到值,可Image1就是不显示所对应的图片,有什么办法解决吗?

[解决办法]
用Js弄
1.
string Url = " <a href= '# ' onclick=getImageName( ' " + imgName + " ', ' " + userId + " ')> 请点击确保上传成功! </a> ";
lbUrl.Visible = true;
lbUrl.Text = Url;
2.
function getImageName(t,c)
{
window.opener.document.getElementById( "imgName ").value=t;
window.opener.document.getElementById( "Image ").src= "/Picture/ "+c+ "/ "+t;
window.close();
}

热点排行