protected void CopyButton_Click(object obj, EventArgs args) { if (CurrentProject != null) { int selectedProjectId = Convert.ToInt32(ProjectList.SelectedValue); List <Category> newCategories = Category.GetCategoriesByProjectId(selectedProjectId); foreach (Category cat in newCategories) { Category newCat = new Category(cat.Abbreviation, cat.EstimateDuration, cat.Name, CurrentProject.Id); newCat.Save(); } CategoryData.DataBind(); ListAllCategories.DataBind(); } }