Beispiel #1
0
        public ActionResult Product(ProductListPage currentPage, string productId)
        {
            var model = ProductListPageViewModelBuilder.Create(currentPage);

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

            return(View("Product", 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();
        }