Nested Repeaters in ASP.NET

前端 未结 4 1334
攒了一身酷
攒了一身酷 2020-12-01 05:13

I have a class that contains hierarchical data. I want to present this data in my ASP.net webapp using nested repeaters. How do I do this? I\'ve only ever done one level

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 05:56

    
        
            
            
        
    
    
    
    R1.ItemDataBound += (s, e) =>
    {
        var r2 = e.Item.FindControl("R2") as Repeater;
        r2.DataSource = something;
        r2.DataBind();
    };
    

    Be aware that FindControl is not recursive, it will only get the children.

提交回复
热议问题