mcamara
mcamara

Reputation: 753

Get Value of ItemData in Repeater into Repeater

I have a Repeater nested in another Repeater. For clarity, we'll refer to them as ParentRepeater and ChildRepeater. I need to get a value from ParentRepeater in ChildRepeater. How can I do this?

Upvotes: 0

Views: 357

Answers (1)

Magnus
Magnus

Reputation: 46909

In the child repeater item the first NamingContainer is the Repeater and the second the parent Repetaer item.

<%# DataBinder.Eval(((RepeaterItem)Container.NamingContainer.NamingContainer).DataItem, "Name") %>

Upvotes: 1

Related Questions