Exemple #1
0
        protected void rptPartnerships_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                PartnerInfoItem navItem = (PartnerInfoItem)e.Item.DataItem;

                HyperLink hlLink = e.FindControlAs <HyperLink>("hlLink");
                Sitecore.Web.UI.WebControls.Image scImage = e.FindControlAs <Sitecore.Web.UI.WebControls.Image>("scImage");
                hlLink.NavigateUrl = navItem.GetUrl();

                scImage.Item = navItem;
            }
        }
        protected void rptPartnerInfo_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                PartnerInfoItem item = (PartnerInfoItem)e.Item.DataItem;

                var itemLink = item.GetUrl();

                FieldRenderer frPartnerName = e.FindControlAs <FieldRenderer>("frPartnerName");

                if (frPartnerName != null)
                {
                    frPartnerName.Item = item;
                    HyperLink hlPartnerNameLink = e.FindControlAs <HyperLink>("hlPartnerNameLink");
                    if (hlPartnerNameLink != null)
                    {
                        hlPartnerNameLink.NavigateUrl = itemLink;
                        hlPartnerNameLink.Visible     = true;
                    }
                }

                Sitecore.Web.UI.WebControls.Image imgPartnerLogo = e.FindControlAs <Sitecore.Web.UI.WebControls.Image>("imgPartnerLogo");
                if (imgPartnerLogo != null)
                {
                    imgPartnerLogo.Item = item;
                    HyperLink hlPartnerLogo = e.FindControlAs <HyperLink>("hlPartnerLogo");
                    if (hlPartnerLogo != null)
                    {
                        hlPartnerLogo.NavigateUrl = itemLink;
                        hlPartnerLogo.Visible     = true;
                    }
                } //imgPartnerLogo


                FieldRenderer frPartnerDescription = e.FindControlAs <FieldRenderer>("frPartnerDescription");
                if (frPartnerDescription != null)
                {
                    frPartnerDescription.Item = item;
                }
                HyperLink hlPartnerSite = e.FindControlAs <HyperLink>("hlPartnerSite");
                if (hlPartnerSite != null)
                {
                    hlPartnerSite.NavigateUrl = itemLink;
                }
            }
        }