I have an asp.net Datalist control in which I have textboxes. I would to add the user's input from these texboxes along with the primary key value of the item. Each datalist item will have a button that will "add" the user input text and the datakey value. I added the code I'm trying below but when I retrieve the values I only get 0 and 0. What would be the best way to do this? Thanks in advance!
ShoppingCart cart = new ShoppingCart();
cart.ProjectID = Convert.ToInt32(DataList1.Items.FindControl("IDLabel.Text"));
cart.Quantity = Convert.ToInt32(DataList1.Items.FindControl("QuantityTextBox.Text"));
Session["Order"] = cart;