private void dropdownlistAmnt_SelectdIndxChang(object sender, EventArgs e) { //id of item that has quantity changed in ddl list DropDownList quantityList = (DropDownList)sender; int cartId = Convert.ToInt32(quantityList.ID); int cartquantity = Convert.ToInt32(quantityList.SelectedValue); //Update purchase with new quantity and refresh page Cart_Model updatecart = new Cart_Model(); updatecart.UpdateCartQuantity(cartId, cartquantity); Response.Redirect("~/Pages/Trolley.aspx"); }