/// <summary> /// Submit event handler. Responsible for creating items. /// </summary> protected void btnSubmit_Click(object sender, EventArgs e) { Page.Validate(); if (IsValid) { foreach (RepeaterItem item in rpBulkItemEditor.Items) { if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem) { var model = new ItemCreatorModel(); //Find controls from item in repeater var ParentNode = (TextBox)item.FindControl("txtParentNode"); var TemplateID = (TextBox)item.FindControl("txtTemplateID"); var NoOfItems = (TextBox)item.FindControl("txtNoOfItems"); var Languages = (CheckBoxList)item.FindControl("cblLanguage"); //Set model values model.NumberOfItems = System.Convert.ToInt32(NoOfItems.Text); model.ParentNode = ParentNode.Text; model.TemplateId = TemplateID.Text; model.Languages = Languages.SelectedValue; //create items in CMS var _itemCreator = new ItemCreator(); _itemCreator.ItemGenerator(model); } } } }