Accessing parent data in nested repeater, in the HeaderTemplate

后端 未结 5 1180
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-30 02:42

Simple question, not sure there\'s a simple answer!

So here\'s the code: (I\'ve simplified it a lot to make it easier to read)



        
5条回答
  •  北海茫月
    2020-11-30 03:31

    If I want to retrieve a property of a parent repeater I typically do this:

    <%# DataBinder.Eval(((RepeaterItem)Container.Parent.Parent).DataItem, "ThePropertyName")%>
    

提交回复
热议问题