Exemplo n.º 1
0
        /// <summary>
        /// Page load - set private properties and page content
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            string ctrlname        = Request.Params.Get("__EVENTTARGET");
            bool   languageChanged = false;

            //checkLoggedOn();
            if (!string.IsNullOrEmpty(ctrlname))
            {
                if ((ctrlname.Contains("cboSelectLanguages")))
                {
                    languageChanged = true;
                }
            }

            if (languageChanged)
            {
                if (ValidationManager.CheckValue(cboSelectLanguages.SelectedValue))
                {
                    List <LinkManager.LinkItem> linkItems = new List <LinkManager.LinkItem>();
                    linkItems.Add(new LinkManager.LinkItem("px_language", cboSelectLanguages.SelectedValue));
                    if (!string.IsNullOrEmpty(PxUrlObj.Layout))
                    {
                        linkItems.Add(new LinkManager.LinkItem(PxUrl.LAYOUT_KEY, PxUrlObj.Layout));
                    }
                    //Replaced Request.Url.AbsolutePath with Request.AppRelativeCurrentExecutionFilePath
                    //so that the links will be right even if the site is running without UserFriendlyURL
                    string url = PCAxis.Web.Core.Management.LinkManager.CreateLink(Request.AppRelativeCurrentExecutionFilePath, false, linkItems.ToArray());
                    Response.Redirect(url);
                }
            }
        }