redirection from iframe page

Page 1 of 2 12 LastLast
  1. #1

    redirection from iframe page

    hi, i am trying to redirect the entire page instead of only the page within the iframe. Is there anyway to do this?

    im using ext.net.redirect("test.aspx") in my iframe page.

    Thanks
  2. #2
    Hi,

    You can call parent page's DirectMethod with .Redirect() call.
  3. #3
    hi,

    would you give an example please?
  4. #4
    Hi,

    Please define on a parent page:
    [DirectMethod]
    public void Redirect(string url)
    {
        X.Redirect(url);
    }
    and call it from IFrame page this way:
    parent.Ext.net.DirectMethods.Redirect("someUrl");
  5. #5
    Thank you,

    but how can i put this in code behind?
    Ext.Net.X.Js.Call("parent.Ext.net.DirectMethods.Redirect", "someurl");  ////not directing...
       ResourceManager.GetInstance().AddScript("parent.Ext.net.DirectMethods.Redirect", "someurl"); /// throws an exception..

    thank you in advance
    Last edited by Daniil; Oct 21, 2011 at 11:37 AM. Reason: Please use [CODE] tags
  6. #6
    Where do you call it?
    Ext.Net.X.Js.Call("parent.Ext.net.DirectMethods.Redirect", "someurl");  ////not directing...
    What url do you really use?
  7. #7
    I call it within a button event and Page_Load.

    Url is a logout page, logout.aspx.
  8. #8
    It works for me. Here is my test case.

    Example Parent Page

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        [DirectMethod]
        public void Redirect(string url)
        {
            X.Redirect(url);
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Panel runat="server">
                <AutoLoad Mode="IFrame" Url="Test.aspx" />
            </ext:Panel>
        </form>
    </body>
    </html>
    Example Child Page

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            Ext.Net.X.Js.Call("parent.Ext.net.DirectMethods.Redirect", "http://google.com");
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
        </form>
    </body>
    </html>
  9. #9
    I forgot to put <ext:ResourceManager runat="server" /> in child page.

    many thanks
  10. #10

    Doesn't work with 2.0

    Quote Originally Posted by Daniil View Post
    It works for me. Here is my test case.

    Example Parent Page

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        [DirectMethod]
        public void Redirect(string url)
        {
            X.Redirect(url);
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Panel runat="server">
                <AutoLoad Mode="IFrame" Url="Test.aspx" />
            </ext:Panel>
        </form>
    </body>
    </html>
    Example Child Page

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            Ext.Net.X.Js.Call("parent.Ext.net.DirectMethods.Redirect", "http://google.com");
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
        </form>
    </body>
    </html>
    Does this work with the 2.0 framework?
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 3
    Last Post: Apr 17, 2012, 5:10 PM
  2. Page redirection
    By norphos in forum 1.x Help
    Replies: 0
    Last Post: Oct 10, 2011, 7:09 AM
  3. [1.0] IFrame communication with parent page
    By olakara in forum 1.x Help
    Replies: 1
    Last Post: Apr 20, 2010, 9:00 AM
  4. [CLOSED] how to avoide redirection login page in Tabs
    By Satyanarayana murthy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 15, 2010, 2:22 PM
  5. Tabpanel Iframe page
    By vali1993 in forum 1.x Help
    Replies: 2
    Last Post: Feb 22, 2010, 3:56 PM

Tags for this Thread

Posting Permissions