Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // get list and pass to user control
            var srv = new ShoppingListController();

            List.shoppingList = srv.getShoppingList();

            // We use view state here to make sure that button clicks etc don't
            // lose the newly created control
            if (ViewState["addNewItem"] != null && (bool)ViewState["addNewItem"])
            {
                var control = LoadControl(@"~\Controls\NewItem.ascx");
                newRecordPlaceholder.Controls.Add(control);
            }
        }