三个Repeater嵌套使用的问题 在第三个Repeater中在嵌套了一个RadioButtonList和一个textbox 当改变RadioButtonList的值后怎么改变textbox的值?最好能给出代码

解决方案 »

  1.   

    1、根据对应规则的ID,js控制
    2、RadioButtonList事件触发后,(webcontrol)sender.Parent.FindControl(textbox.id)
      

  2.   

    在RadioButtonList 后台事件里 protected void RadioButtonList _XXX(object sender, EventArgs e)
    {
        RadioButtonList cb = sender as RadioButtonList ;
                object parent = cb.Parent;
                System.Web.UI.WebControls.RepeaterItem ri = (parent as            System.Web.UI.WebControls.RepeaterItem);
                TextBox txtXX ri.FindControl("txtXX") as TextBox ;
                txtXX.Text="";
    }