[CLOSED] Session expired into iframe

  1. #1

    [CLOSED] Session expired into iframe

    Hi,

    When the session expires in an iframe, how do I redirect to a login page outside the iframe?

    My context:

    I have a base page, where all my other pages inherit.

    public abstract partial class PaginaBase : System.Web.UI.Page
        {       
    
            private usuario usuario;
            protected usuario Usuario
            {
                get
                {
                    if (usuario == null)
                        usuario = (usuario)this.Session[Aplicacao.USUARIO_SESSAO];
                    return usuario;
                }
            }        
    
            protected override void OnInit(EventArgs e)
            {
                base.OnInit(e);
                this.Load += new EventHandler(PaginaBase_Load);
            }
    
           
            protected void PaginaBase_Load(object sender, EventArgs e)
            {
                if (this.Session[Aplicacao.USUARIO_SESSAO] == null)
                {
                    string url = this.Request.Url.Segments.LastOrDefault();
    
                    if (!url.Equals(Aplicacao.PAGINA_PRINCIPAL))
                    {
                        X.Js.Call("parent.location.href = self.document.location");
                        X.Js.Call("parent.reload()"); 
                    }
                    else
                    {
                        this.Response.Redirect("../Login/Login.aspx");   
                    }
                }
            }  
        }
    In my index.aspx page I inherit the basepage.aspx.

    This panel below is child of the index.aspx

    <ext:Panel ID="PnlRecuperarDocumentoID" runat="server"  Border="false" Title="Pesquisa de Documento" Layout="AbsoluteLayout" IconCls="icon-recuperardocumento" Height="300" Width="380" AutoScroll="true"  >
                                        <AutoLoad Url="../Forms/RecuperarDocumento.aspx" Mode="IFrame"  ShowMask="true" MaskMsg = "Carregando ..." /> 
                                        <Tools>
                                            <ext:Tool Type="Refresh" Qtip="Recarregar página" Handler="#{PnlRecuperarDocumentoID}.reload();" />
                                        </Tools>
                                    </ext:Panel>
    When the session expires in RecuperarDocumento.aspx the login page appears within RecuperarDocumento.aspx.
    How do I put the page index.aspx in the context and then redirect to login.aspx?

    Thanks.
    Last edited by Daniil; Jan 11, 2012 at 6:30 PM. Reason: [CLOSED]
  2. #2
    Hi,

    You can call a parent's DirectMethod with the redirection code.
    X.JS.Call("parent.Ext.net.DirectMethods.RedirectToLogin");
    To redirect please use:
    X.Redirect("url");
  3. #3
    Hi Daniil,

    Thanks for your helper.

    Please, mark as solved.

Similar Threads

  1. [CLOSED] Session NullException
    By supera in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Feb 02, 2012, 4:24 PM
  2. Replies: 4
    Last Post: Jan 22, 2012, 2:52 PM
  3. Timeout expired error in AjaxStoreResult class
    By vs.mukesh in forum 1.x Help
    Replies: 0
    Last Post: Mar 15, 2011, 7:52 AM
  4. [CLOSED] Access component in IFrame from oter IFrame
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Feb 22, 2010, 5:58 PM
  5. [CLOSED] ASP.NET Session and Coolite
    By shahidmughal in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 08, 2009, 12:48 AM

Tags for this Thread

Posting Permissions