Beispiel #1
0
 protected override void OnPreRender(EventArgs e)
 {
     if (Page is PageBase)
     {
         PageBase page = Page as PageBase;
         MenuDataItem menu = page.CurrentMenu;
         if (menu != null)
         {
             Localize locTitle = new Localize();
             locTitle.Text = menu.Page.PageName;
             Title.Controls.Add(locTitle);
         }
     }
     base.OnPreRender(e);
 }
Beispiel #2
0
        protected override void OnPreRender(EventArgs e)
        {
            if (Page is PageBase)
            {
                PageBase page = Page as PageBase;
                MenuDataItem menu = page.CurrentMenu;

                string txt = "<a href='../SystemManagement/MainPage.aspx'>Home</a>";

                //string txt = "  <span class='top-links' onclick=\"window.location='~/SystemManagement/MainPage.aspx'\" style='cursor: hand;'>Home</span>";

                if (menu != null)
                {

                    //Localize locTitle = new Localize();
                    //locTitle.Text += menu.Page.PageName;
                    //Title.Controls.Add(locTitle);
                    if (menu.ParentMenu != null)
                    {
                        //Localize locParent = new Localize();
                        //locParent.Text = menu.ParentMenu.Page.PageName;
                        //ParentTitle.Controls.Add(locParent);
                        string pageUrl = menu.ParentMenu.SubMenu.Count > 0 ? menu.ParentMenu.SubMenu[0].Page.PageUrl : "#";
                        txt += " > <a href='" + pageUrl.Replace("~", "..") + "'>" + menu.ParentMenu.Page.PageName + "</a>";
                    }

                    txt += " > <a href='" + menu.Page.PageUrl.Replace("~", "..") + "'>" + menu.Page.PageName + "</a>";

                }
                Localize locParent = new Localize();
                locParent.Text = txt;
                ParentTitle.Controls.Add(locParent);
            }
            //SearchToggleVisible = false;
            base.OnPreRender(e);
        }