如果使用js的页是在框架中  
  top.frameName.document.all.ElementId  
  如果使用js的页是从框架页面上新开的页面  
  opener.top.frameName.document.all.ElementId 
 
iframe父子窗口间js方法调用2009-04-15 15:38父窗口调用iframe子窗口方法<iframe name="myFrame" src="child.html"></iframe> 
myFrame.window.functionName();
iframe子窗口调用父窗口方法parent.functionName();父窗口页面<html>   
<head>   
<script   type="text/javascript">   function say() {
   alert("parent.html------>I'm at parent.html");
   } function callChild()
{   
   //document.frames("myFrame").f1();
   myFrame.window.say();
}   
</script>   
</head>   
    
<body>     
<input   type=button   value="调用child.html中的函数say()" onclick="callChild()"> 
<iframe name="myFrame" src="child.html"></iframe> 
</body>   
</html>  
子窗口页面<html>   
<head>   
<script type="text/javascript">
      
function say()   
{   
          alert("child.html--->I'm at child.html");   
} function callParent() {
   parent.say();
   } 
</script>   
</head>   
<body>   
<input   type=button   value="调用parent.html中的say()函数"   onclick="callParent()">   
</body>   
</html>
 

解决方案 »

  1.   

    用了iframe之后,其实属于跨页提交了通过PreviousPage提取数据
    if (Page.PreviousPage != null )
            {
                if (Page.PreviousPage.IsCrossPagePostBack)
                {
                    string msg = ((TextBox)PreviousPage.FindControl("ItemName")).Text;
                    Response.Write("<script>alert('"+msg +"')</script>");//弹出提示,进行测试
                }
     }iframe中的提交按钮
    <asp:Button ID="Button1" PostBackUrl="~/TreeModeOnly.aspx" runat="server" Text="提交" />
      

  2.   

    仔细检查下自己写的URL,拼接好像是有问题的
    用debugger进行脚本调试下吧