我在iframe 中有个linkbutton,我想点击的时候跳转到另一个页面,直接写在事件里,只是把我要跳转的页面再放到iframe里,不跳出啊!!!!!!!!!!!怎么办啊

解决方案 »

  1.   


    HTML 框架 iframe iframe父子窗口间js方法调
    如果使用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>
     
      

  2.   

    既然是iframe 的话
    你就可以再LinkButton 的OnClientClick事件里这样写
    如果你的iframe 的id是IF
    OnClientClick="FF();";
    //js部分
    function FF()
    {
      document.getElementById("IF").src="newPage.htm";
    }
      

  3.   

    Default.aspx:<iframe id="myframe" src="Default2.aspx"></iframe>Default2.aspx:<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>无标题页</title>
        <script type="text/javascript" language="javascript">
        function test(){
        alert("测试");
        parent.document.getElementById('myframe').src='Default3.aspx';
        }
        </script>
    </head>
    <body>
        <input id="Button1" type="button" value="button"   onclick="test()"/>
    </body>
    </html>
      

  4.   

     <iframe target="你要显示内容的另一个IFRAME的NAME"> 
      

  5.   

    <iframe>里面有个button
    事件可以这样写
    Response.Write("<script>parent.window.location.href('a.aspx')</script>");这样就可以跳出框架页面重新进入一个新页面了.
      

  6.   


    //这是整框架跳装
    Response.Write("<script>window.top.navigate('....aspx');</script>");
    //这是某个框架跳转(ID为left的框架)
    document.getElementById("left").src="left.aspx";
      

  7.   

    <iframe id="show" height="500" width="600" src=""></iframe>
    <script type="text/javascript">
      var show = document.getElementById('show');
      setInterval("show.src='http://student.csdn.net/space.php'",10000);
    </script>为什么iframe中显示出来的页面,以转到该地址就跳出iframe,跳到主页面。
    为什么试试其他网址就不会跳出,而直接显示在iframe中,10秒刷新一次~