Nested repeater: How do nested repeater columns reference external repeater columns?
Source: Internet
Author: User
Nested repeater: How do nested repeater columns reference external repeater columns?
That is to say, I want to reference the value of an external repeater column in the repeater itemtemplete.
<! -- Start parent repeater -->
<Asp: repeater id = "parent" runat = "server">
<Itemtemplate>
<B> <% # databinder. eval (container. dataitem, "au_id") %> </B> <br>
How to Implement the effect of the top-side ** * ** line? If you follow the preceding method, an error will occur.
Step 1:
Declare a variable in the background code of the page:
Protected object parentdataitem; // note that the object is protected.
Step 2:
Then process the itemdatabound event of the parent control:
Private void parent_itemdatabound (Object sender, system. Web. UI. webcontrols. repeateritemeventargs E)
{
Parentdataitem = E. Item. dataitem;
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.