Exemplo n.º 1
0
        protected void PopulateControls()
        {
            string  prodID = Request.QueryString["ProductID"];
            Product pd     = CatalogAccess.GetProductDetails(prodID);

            titleLable.Text        = pd.Name;
            descLabel.Text         = pd.Description;
            targetLevelLabel.Text  = pd.TargetLevel.ToString();
            reorderLevelLabel.Text = pd.ReorderLevel.ToString();
            priceLabel.Text        = String.Format("{0:c}",
                                                   pd.ListPrice);
        }
        protected void PopulateControls()
        {
            string categoryID = Request.QueryString["CategoryID"];

            if (categoryID != null)
            {
                DataList1.DataSource = CatalogAccess.GetProductsInCategory(categoryID);
                DataList1.DataBind();
            }

            else
            {
                DataList1.DataSource = CatalogAccess.GetProductsInCategory("1");
                DataList1.DataBind();
            }
        }