Пример #1
0
        public override void LoadMenu()
        {
            Trace.Write("Begin Menu");
            MenuItem mu = MenuItem.FindMenu(this.Page.AppRelativeVirtualPath);

            if (mu != null)
            {
                plhMenu.Controls.Clear();
                plhDropDownMenus.Controls.Clear();

                Trace.Write("Begin Basic Menu");
                HtmlControl hc = mu.CreateMenu();
                if (hc != null)
                {
                    plhMenu.Controls.Add(hc);
                }
                Trace.Write("Begin Basic Menu");

                Trace.Write("Begin DropDowns");
                IList <HtmlControl> dropMenus = mu.CreateDropDownMenus();
                if (dropMenus != null)
                {
                    foreach (HtmlControl ctrl in dropMenus)
                    {
                        plhDropDownMenus.Controls.Add(ctrl);
                    }
                }
                Trace.Write("End DropDowns");

                if (this.Page is MenuPage)
                {
                    string title = (this.Page as MenuPage).GetTitle();
                    if (!string.IsNullOrEmpty(title))
                    {
                        mu.AlternativeTitle = title;
                        this.Page.Title     = "Prices Manager Advanced - " + title;
                    }
                }
                else
                {
                    this.Page.Title = "Prices Manager Advanced - " + mu.Description;
                }

                this.lblPageTitle.Controls.Clear();
                this.lblPageTitle.Controls.Add(mu.GetCurrentPageTitle());
            }

            Trace.Write("End Menu");
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack && !string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                PriceMasterList1.ProductId = Convert.ToInt32(Request.QueryString["id"]);
                PriceMasterList1.DataBind();
                PriceMasterList1.ShowFilters = false;

                MenuItem mu = MenuItem.FindMenu(this.Page.AppRelativeVirtualPath);
                if (mu != null)
                {
                    Page.Title += " - " + mu.Description;
                }
            }
        }