protected void rptTestimonial_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                cTestimonial testimonial = (cTestimonial)e.Item.DataItem;

                Panel pnTestimonial = (Panel)e.Item.FindControl("pnTestimonial");
                if (e.Item.ItemIndex == 0)
                {
                    pnTestimonial.CssClass = "item active";
                }
                else
                {
                    pnTestimonial.CssClass = "item";
                }

                Literal ltTestimonial = (Literal)e.Item.FindControl("ltTestimonial");
                ltTestimonial.Text = testimonial.testimonial;

                Literal ltTestimonialName = (Literal)e.Item.FindControl("ltTestimonialName");
                ltTestimonialName.Text = testimonial.autor;

                Literal ltTestimonialLocal = (Literal)e.Item.FindControl("ltTestimonialLocal");
                ltTestimonialLocal.Text = testimonial.local;

                Image imgTestimonial = (Image)e.Item.FindControl("imgTestimonial");
                imgTestimonial.ImageUrl = "~/assets/" + _enterpriseId + "/testimonials/profile-" + testimonial.testimonialId + ".jpg";
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                cEnterprise enterprise = _business.GetEnterprise();
                imgAbout.ImageUrl = "assets/" + _enterpriseId.ToString() + "/about/about.jpg";
                ltAbout.Text      = enterprise.description;

                cTestimonial testimonial = _business.GetTestimonials().FirstOrDefault();
                ltTestimonial.Text      = testimonial.testimonial;
                ltTestimonialName.Text  = testimonial.autor;
                ltTestimonialLocal.Text = testimonial.local;

                wucContact._enterprise = enterprise;
            }
        }