Beispiel #1
0
        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);

            ProductList.DataSource = FakeProductDatabase.GetProducts();
            ProductList.DataBind();
        }
Beispiel #2
0
        public static ProductListPageViewModel Create(ProductListPage currentPage)
        {
            var model = new ProductListPageViewModel(currentPage);

            PageViewModelBuilder.SetBaseProperties(model);
            model.Products = FakeProductDatabase.GetProducts();
            return(model);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // Our IPageExtender should have attached a productid
            var productId = Request.QueryString["productid"];

            // Get the product from our fake product store
            var product = FakeProductDatabase.GetProduct(productId);

            // Lets populate the controls with out product data
            Heading.Text     = product.Name;
            Description.Text = product.Description;

            // Get all the products and bind it to our menu repeater
            ProductList.DataSource = FakeProductDatabase.GetProducts();
            ProductList.DataBind();
        }