/// <summary>
        /// Handles the Load event of the DesktopDefault control.
        /// </summary>
        /// <param name="sender">
        /// The source of the event.
        /// </param>
        /// <param name="e">
        /// The <see cref="System.EventArgs"/> instance containing the event data.
        /// </param>
        private void DesktopDefault_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.Params["panelist"]))
            {
                this.RenderContentAreaList();
            }
            // intento obtener el id de la pagina desde el query
            string query  = Request.Url.Query;
            int    pageId = 0;

            if (query.Contains("?") && query.ToLower().Contains("pageid"))
            {
                int index       = query.IndexOf('?');
                int indexPageId = query.ToLower().IndexOf("pageid") + 5;
                if (index < indexPageId - 5)
                {
                    query = query.Substring(indexPageId + 2, query.Length - indexPageId - 2);
                    index = query.IndexOf('&');
                    if (index > 0) // no va hasta el final el numero de pagina
                    {
                        query = query.Substring(0, index);
                    }
                    try
                    {
                        pageId = int.Parse(query);
                    }
                    catch (Exception)
                    {
                        pageId = 0;
                    }
                }
                else
                {
                    pageId = 0;
                }
            }
            else
            {
                pageId = this.PortalSettings.ActivePage.PageID;
            }

            if (pageId == 0)
            {
                pageId = Convert.ToInt32(SiteMap.RootNode.ChildNodes[0].Key);
                this.Response.Redirect(HttpUrlBuilder.BuildUrl(pageId));
            }

            string urlToRedirect = "";
            bool   redirect      = HttpUrlBuilder.ValidateProperUrl(pageId, ref urlToRedirect);

            if (!redirect)
            {
                this.Response.Redirect(urlToRedirect);
            }

            if (!PortalSecurity.IsInRoles(this.PortalSettings.ActivePage.AuthorizedRoles) &&
                !this.User.IsInRole("Admins"))
            {
                PortalSecurity.AccessDenied();
            }
            else
            {
                if (this.Request.Params["r"] == null || this.Request.Params["r"] != "0")
                {
                    var user = Membership.GetUser();
                }

                var userName = this.Request.Params["u"];
                var pass     = this.Request.Params["p"];
                if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(pass))
                {
                    // PortalSecurity.SignOn(userName, pass, false, "~/DesktopDefault.aspx");
                    var rem = (this.Request.Params["rem"] ?? "0").Equals("1") ? true : false;
                    PortalSecurity.SignOn(userName, pass, rem, "~/DesktopDefault.aspx");
                    this.Response.Redirect("~/DesktopDefault.aspx");
                }


                if (string.IsNullOrEmpty(Request.Params["panelist"]))
                {
                    this.LoadPage();
                }
            }
        }