protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["Sesion" + Session.SessionID] == null)
                {
                    return;
                }

                if (!Page.IsPostBack)
                {
                    if (!Page.ClientScript.IsClientScriptIncludeRegistered("prototype"))
                    {
                        Page.ClientScript.RegisterClientScriptInclude("prototype", ResolveUrl("../prototype.js"));
                    }

                    //Session.Timeout = 1;
                    //Response.AddHeader("Refresh", Convert.ToString((Session.Timeout * 60) + 5) + ";URL=Login.aspx?Id=2");

                    HiddenField1.Value = Session.SessionID;
                    Sesion Sesion = new Sesion();
                    Sesion = (Sesion)Session["Sesion" + Session.SessionID];

                    //Asigna los valores del encabezado
                    //this.RadSkinManager1.Skin = Sesion.Skin_Descripcion;
                    lblNombre.Text = "*" + Sesion.U_Nombre;

                    //CambiaLogo(Sesion.Emp_Cnx, Sesion.Emp_Pref);
                    //ValidarPermisos(Sesion.Emp_Cnx, Sesion.Id_U, Sesion.Id_Ofi);
                    //Carga el menú
                    DataTable DT = (DataTable)Session["DTMenu" + Session.SessionID];
                    this.RadMenu1.DataSource           = DT;
                    this.RadMenu1.DataFieldID          = "Sm_Cve";
                    this.RadMenu1.DataFieldParentID    = "Sm_Sm_Cve";
                    this.RadMenu1.DataNavigateUrlField = "Sm_Href";
                    this.RadMenu1.DataTextField        = "Sm_Desc";
                    this.RadMenu1.DataValueField       = "Sm_Cve";

                    this.RadMenu1.DataBind();
                    if (RadMenu1.FindItemByValue("1") != null)
                    {
                        RadMenu1.FindItemByValue("1").ImageUrl = @"~\Imagenes\" + DT.Select("Sm_Cve=2")[0]["Sm_Img"];
                    }
                    if (RadMenu1.FindItemByValue("2") != null)
                    {
                        RadMenu1.FindItemByValue("2").ImageUrl = @"~\Imagenes\" + DT.Select("Sm_Cve=2")[0]["Sm_Img"];
                    }
                    if (RadMenu1.FindItemByValue("22") != null)
                    {
                        RadMenu1.FindItemByValue("22").ImageUrl = @"~\Imagenes\" + DT.Select("Sm_Cve=22")[0]["Sm_Img"];
                    }
                    if (RadMenu1.FindItemByValue("33") != null)
                    {
                        RadMenu1.FindItemByValue("33").ImageUrl = @"~\Imagenes\" + DT.Select("Sm_Cve=33")[0]["Sm_Img"];
                    }
                    if (RadMenu1.FindItemByValue("54") != null)
                    {
                        RadMenu1.FindItemByValue("54").ImageUrl = @"~\Imagenes\" + DT.Select("Sm_Cve=54")[0]["Sm_Img"];
                    }
                    if (RadMenu1.FindItemByValue("72") != null)
                    {
                        RadMenu1.FindItemByValue("72").ImageUrl = @"~\Imagenes\" + DT.Select("Sm_Cve=72")[0]["Sm_Img"];
                    }
                    if (RadMenu1.FindItemByValue("144") != null)
                    {
                        RadMenu1.FindItemByValue("144").ImageUrl = @"~\Imagenes\" + DT.Select("Sm_Cve=144")[0]["Sm_Img"];
                    }


                    if (Session["Head" + Session.SessionID] != null)
                    {
                        this.RadioButton1.Text = Session["Head" + Session.SessionID].ToString();
                    }

                    //string path = Request.PhysicalPath;
                    //lblFechaMod.Text = "Última fecha de modificación de " + System.IO.Path.GetFileName(path) + ": " + System.IO.File.GetLastWriteTime(path).ToString();
                }
                else
                {
                    if (HiddenField1.Value != Session.SessionID)
                    {
                        //this.lblMensaje.Text = "regresando a inicio";
                        Response.Redirect("inicio.aspx");
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Page.IsPostBack == false)
                {
                    HiddenField1.Value = Session.SessionID;
                    Sesion Sesion = new Sesion();
                    Sesion = (Sesion)Session["Sesion" + Session.SessionID];

                    //Asigna los valores del encabezado
                    //this.RadSkinManager1.Skin = Sesion.Skin_Descripcion;
                    lblNombre.Text = "*" + Sesion.U_Nombre;

                    //CambiaLogo(Sesion.Emp_Cnx, Sesion.Emp_Pref);
                    //ValidarPermisos(Sesion.Emp_Cnx, Sesion.Id_U, Sesion.Id_Ofi);
                    //Carga el menú
                    DataTable DT = (DataTable)Session["DTMenu" + Session.SessionID];
                    this.RadMenu1.DataSource           = DT;
                    this.RadMenu1.DataFieldID          = "Sm_Cve";
                    this.RadMenu1.DataFieldParentID    = "Sm_Sm_Cve";
                    this.RadMenu1.DataNavigateUrlField = "Sm_Href";
                    this.RadMenu1.DataTextField        = "Sm_Desc";
                    this.RadMenu1.DataValueField       = "Sm_Cve";

                    this.RadMenu1.DataBind();
                    if (RadMenu1.FindItemByValue("1") != null)
                    {
                        RadMenu1.FindItemByValue("1").ImageUrl = @"~\Imagenes\" + DT.Select("Sm_Cve=2")[0]["Sm_Img"];
                    }
                    if (RadMenu1.FindItemByValue("2") != null)
                    {
                        RadMenu1.FindItemByValue("2").ImageUrl = @"~\Imagenes\" + DT.Select("Sm_Cve=2")[0]["Sm_Img"];
                    }
                    if (RadMenu1.FindItemByValue("22") != null)
                    {
                        RadMenu1.FindItemByValue("22").ImageUrl = @"~\Imagenes\" + DT.Select("Sm_Cve=22")[0]["Sm_Img"];
                    }
                    if (RadMenu1.FindItemByValue("33") != null)
                    {
                        RadMenu1.FindItemByValue("33").ImageUrl = @"~\Imagenes\" + DT.Select("Sm_Cve=33")[0]["Sm_Img"];
                    }
                    if (RadMenu1.FindItemByValue("54") != null)
                    {
                        RadMenu1.FindItemByValue("54").ImageUrl = @"~\Imagenes\" + DT.Select("Sm_Cve=54")[0]["Sm_Img"];
                    }
                    if (RadMenu1.FindItemByValue("72") != null)
                    {
                        RadMenu1.FindItemByValue("72").ImageUrl = @"~\Imagenes\" + DT.Select("Sm_Cve=72")[0]["Sm_Img"];
                    }
                    if (RadMenu1.FindItemByValue("144") != null)
                    {
                        RadMenu1.FindItemByValue("144").ImageUrl = @"~\Imagenes\" + DT.Select("Sm_Cve=144")[0]["Sm_Img"];
                    }


                    if (Session["Head" + Session.SessionID] != null)
                    {
                        this.RadioButton1.Text = Session["Head" + Session.SessionID].ToString();
                    }
                }
                else
                {
                    if (HiddenField1.Value != Session.SessionID)
                    {
                        Response.Redirect("inicio.aspx");
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name);
            }
        }