예제 #1
0
        private void LoadCtrsl()
        {
            int iMax = this.Controls.Count;

            SetTag();

            ctrlAll.Controls.Clear();
            ctrlAll.Controls.Add(litOpen);

            //instead of wind/unwind, pop stack X times
            for (int i = 0; i < iMax; i++) {
                ctrlAll.Controls.Add(this.Controls[0]);
            }

            ListItemPlaceHolder ph = new ListItemPlaceHolder();

            ctrlAll.Controls.Add(ph);
            ctrlAll.Controls.Add(litClose);

            this.Controls.Clear();
            this.Controls.Add(ctrlAll);
        }
예제 #2
0
        public void InstantiateIn(Control container)
        {
            ListItemPlaceHolder phAll = new ListItemPlaceHolder();

            NavLinkForTemplate lnk = new NavLinkForTemplate();
            lnk.LinkText = " LINK ";
            lnk.NavigateUrl = "#";

            ListItemWrapper wrap = new ListItemWrapper();
            wrap.Controls.Add(lnk);

            lnk.DataBinding += new EventHandler(lnkContent_DataBinding);

            phAll.Controls.Add(wrap);

            container.Controls.Add(phAll);
        }
        protected void SetSubNav(RepeaterItem container, Guid rootContentID)
        {
            Control ctrl = FindSubControl(container);

            if (ctrl == null) {
                ctrl = new ListItemPlaceHolder();
                container.Controls.Add(ctrl);
            } else {
                Control ctrl2 = FindSubControl(ctrl);
                if (ctrl2 != null) {
                    ctrl = ctrl2;
                }
            }

            List<SiteNav> lstNav = GetChildren(rootContentID);

            if (lstNav != null && lstNav.Count > 0) {
                ListItemRepeater rSubNav = new ListItemRepeater();

                rSubNav.ID = "rSubNav";
                rSubNav.HeaderTemplate = SubNavHeaderTemplate;
                rSubNav.ItemTemplate = SubNavTemplate;
                rSubNav.FooterTemplate = SubNavFooterTemplate;

                ctrl.Controls.Add(rSubNav);

                rSubNav.DataSource = lstNav;
                rSubNav.DataBind();

                rSubNav.EnableViewState = this.EnableViewState;

                UpdateHyperLink(rSubNav);
            }
        }