In the CS post-file of ASP. NET, you cannot directly use the control ID to operate the child control in the data binding control. You must use findcontrol to locate the control.
// Find the child control protected void repeaterincluitemdatabound (Object sender, repeateritemeventargs E) in repeater {// E. item. itemtype is the type of the current row if (E. item. itemtype = listitemtype. item | E. item. itemtype = listitemtype. alternatingitem) {// find the Textbox Control whose ID is btndelete, E. item indicates the currently bound textbox txtname = (textbox) E. item. findcontrol ("btndelete"); txtname. TEXT = "I am the child control found in repeater"; }}// find the child control protected void listviewincluitemdatabound (Object sender, listviewitemeventargs E) in listview) {// here is slightly different from repeater if (E. item. itemtype = listviewitemtype. dataitem) {textbox txtname = (textbox) E. item. findcontrol ("btndelete"); txtname. TEXT = "I am a child control found in listview ";}}
After the datatable is bound to the repeater, obtain a field value of the current data row:
Datarow ROW = (datarow) (datarowview) E. Item. dataitem). row;
String parentid = row ["parentid"]. tostring (); // obtain the parentid value of the current data row