コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            IList <Product> products = ProductDataSource.GetNewProducts(this.UseDays, this.Days, this.MaxItems, 0, "CreatedDate DESC");

            if (products != null && products.Count > 0)
            {
                if (!string.IsNullOrEmpty(this.Caption))
                {
                    CaptionLabel.Text = this.Caption;
                }
                ProductList.RepeatColumns = Columns;
                ProductList.DataSource    = products;
                ProductList.DataBind();
            }
            else
            {
                this.Visible = false;
            }
        }