protected void Page_Load(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(this.Caption))
     {
         CaptionLabel.Text = this.Caption;
     }
     ProductList.DataSource = ProductDataSource.GetRandomFeaturedProducts(0, true, IncludeOutOfStockItems, this.Size);
     ProductList.DataBind();
 }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(this.Caption))
            {
                CaptionLabel.Text = this.Caption;
            }
            ProductList.RepeatColumns   = this.Columns;
            ProductList.ItemStyle.Width = new System.Web.UI.WebControls.Unit(100 / this.Columns, System.Web.UI.WebControls.UnitType.Percentage);
            var products = ProductDataSource.GetRandomFeaturedProducts(0, true, IncludeOutOfStockItems, this.Size);

            this.Visible           = products != null && products.Count > 0;
            ProductList.DataSource = products;
            ProductList.DataBind();
        }