1. Bind a field of the parent Repeater to the child Repeater:
Method 1
| The code is as follows: |
Copy code |
: <% # DataBinder. Eval (Container. NamingContainer. NamingContainer as RepeaterItem). DataItem, "PropertyName") %>
|
Method 2
| The code is as follows: |
Copy code |
: <% # DataBinder. Eval (Container. Parent. Parent as RepeaterItem). DataItem, "PropertyName") %>
|
Layer 2 nesting
| The code is as follows: |
Copy code |
: <% # DataBinder. Eval (Container. Parent. Parent as RepeaterItem). DataItem, "PropertyName") %>
|
Layer-3 nesting: <
| The code is as follows: |
Copy code |
% # DataBinder. Eval (Container. Parent. Parent as RepeaterItem). DataItem, "PropertyName") %>
|
Layer-4 Nesting
| The code is as follows: |
Copy code |
: <% # DataBinder. Eval (Container. Parent. Parent as RepeaterItem). DataItem, "PropertyName") %>
|
2. Reference the value of a control of the parent Repeater in the child Repeater:
| The code is as follows: |
Copy code |
| <% # (Container. Parent. Parent. FindControl ("txtUserID") as TextBox). Text %> |