protected void Page_Load(object sender, EventArgs e) { int prefferedCategoryId = AbleCommerce.Code.PageHelper.GetCategoryId(); IList <Product> products = ProductDataSource.GetPopularProducts(this.MaxItems, prefferedCategoryId); if (products != null && products.Count > 0) { CaptionLabel.Text = this.Caption; ProductList.RepeatColumns = Columns; ProductList.DataSource = products; ProductList.DataBind(); } else { this.Visible = false; } }