Repeater嵌套DropDownList如何实现OnSelectedIndexChanged

protected void selChengji_OnSelectedIndexChanged(object sender, EventArgs e)
{
      DropDownList drop 
= sender as DropDownList; //获取当前选中的DropDownList
        Repeater repS 
= drop.Parent.Parent as Repeater; //drop的上一级的上一级控件就是Repeater控件
        
int n = ((RepeaterItem)drop.Parent).ItemIndex; //获取当前选中行的索引
           //获取其他信息进行操作
        HtmlInputText xuefen 
= (HtmlInputText)(repS.Items[n].FindControl("txtXuefen"));
        
string id = ((HtmlInputHidden)(repS.Items[n].FindControl("txtId"))).Value;
           ......

    }
原文地址:https://www.cnblogs.com/wucf2004/p/784520.html