Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //TODO: Beim Aufruf der Seite ohne ProductGroupParameter wird der Breadcrumb nicht angezeigt (Info aus Filter)
            BBStoreController Controller = new BBStoreController();
            int ParentNode;

            if (Request["productgroup"] != null)
            {
                ParentNode = Convert.ToInt32(Request["productgroup"]);

                // We retrieve the treepath of the ParentNode
                string treePath = Controller.GetProductGroupPath(PortalSettings.PortalId, ParentNode);

                Label lbl = new Label();
                lbl.Text = Separator;
                phBreadCrumb.Controls.Add(lbl);

                // Now lets build the breadcrumb
                string[]   bread = treePath.Split('/');
                LinkButton cmdBread;

                for (int i = 0; i < bread.Length; i++)
                {
                    cmdBread = new LinkButton();
                    int productGroupId = Convert.ToInt32(bread[i].Substring(1));
                    cmdBread.Attributes.Add("productgroup", productGroupId.ToString());
                    ProductGroupInfo pgi = Controller.GetProductGroup(PortalSettings.PortalId, System.Threading.Thread.CurrentThread.CurrentCulture.Name, productGroupId);
                    cmdBread.Text     = pgi.ProductGroupName;
                    cmdBread.Click   += new EventHandler(cmdBread_Click);
                    cmdBread.CssClass = "SkinObject";
                    phBreadCrumb.Controls.Add(cmdBread);

                    if (i + 1 < bread.Length)
                    {
                        lbl      = new Label();
                        lbl.Text = Separator;
                        phBreadCrumb.Controls.Add(lbl);
                    }
                }
            }
        }