I have a Repeater inside a Repeater, how can a use the code below:
<input type="hidden" value='<%# Container.ItemIndex %>' />
pointing to the first repeater?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This question is similar; although it talks about accessing a property from the
<HeaderTemplate>, it feels like it should work from the<ItemTemplate>.So try
<%# ((RepeaterItem)Container.Parent.Parent).ItemIndex %>If this doesn’t work, you may need more
.Parents. Try attaching anItemDataBoundhandler to the inner repeater temporarily, and use the fact that theRepeaterItemEventArgsItemproperty returns the same object asContainergives in the aspx. So basically evaluatee.Item.Parent,e.Item.Parent.Parentetc. until you find the one that is anotherRepeaterItem. Then use the same number of.Parents in your aspx.