Assuming BtnSave also inside the repeater.
You will get RepeaterItem by clicking the NamingContainer button. Then you can use FindControl to get a link to your DropDownList :
protected void BtnSaveClick(object sender, EventArgs e) { var btn = (Button)sender; var item = (RepeaterItem)btn.NamingContainer; var ddl = (DropDownList) item.FindControl("ddlWorkflowMembers"); // ... }
If the button is outside the repeater, and you want to save all the elements, you need to do everything:
protected void BtnSaveClick(object sender, EventArgs e) { foreach(RepeaterItem item in WorkflowListAfter.Items) { var ddl = (DropDownList) item.FindControl("ddlWorkflowMembers"); // ... } }
Tim schmelter
source share