iframe一个页面操作完成后给父页面赋值 <td width="680"> <img alt="" src="../images/detail_no_pic.gif" mce_src="images/detail_no_pic.gif" width="1" height="1" id="txtHI_OutdoorImage3" /> <asp:TextBox ID="txtHI_OutdoorImage0" runat="server" Width="40px" Style="display: none;" mce_Style="display: none;"></asp:TextBox> <asp:TextBox ID="txtHI_OutdoorImage1" runat="server" Width="40px" Style="display: none;" mce_Style="display: none;"></asp:TextBox> <asp:TextBox ID="txtHI_OutdoorImage2" runat="server" Width="40px" Style="display: none;" mce_Style="display: none;"></asp:TextBox> <iframe src="../UserControls/upload.aspx?txtid=txtHI_OutdoorImage&savefile=<%=savefile %>" frameborder="0" height="30" allowtransparency="true" scrolling="no"></iframe> <span class="red">*</span> </td> protected void btnUpload_Click(object sender, EventArgs e) { //判断是否有选中文件 if (!fileUpload.HasFile) { ETHaiNan.Common.JScript.Alert("没有选择文件"); return; } string strId = ETHaiNan.Common.StringUtil.GetSaftString(Request.QueryString["txtid"]).Trim(); string strSaveFile = ETHaiNan.Common.StringUtil.GetSaftString(Request.QueryString["savefile"]).Trim();//上传的文件夹 //返回图片路径(含图片文件名),图片大小,图片最后修改时间,输出结果方便调试 string[] arrResult = ImageFTP.FtpUp(fileUpload, strSaveFile); //Response.Write("路径:" + arrResult[0].ToString() + "<br />"); //Response.Write("大小:" +arrResult[1].ToString() + "<br >"); //Response.Write("时间:" + arrResult[2].ToString()); string strJs = "<mce:script type="text/javascript"><!-- "; strJs += "parent.document.getElementById('"+strId+"3').src='"+ConfigurationManager.AppSettings["ImgServer"].ToString()+"/"+arrResult[0]+"';"; strJs += "parent.document.getElementById('"+strId+"3').style.width='100px';"; strJs += "parent.document.getElementById('" + strId + "3').style.height='100px';"; strJs += "parent.document.getElementById('" + strId + "0').value='" + arrResult[0] + "';"; strJs += "parent.document.getElementById('"+strId+"1').value='"+arrResult[1]+"';"; strJs += "parent.document.getElementById('" + strId + "2').value='" + arrResult[2] + "';"; strJs += " // --></mce:script>"; Page.RegisterClientScriptBlock("ok",strJs); }