Obtaining information from a parent control
I am trying to obtain information from a parent control in ASP .net.
First let me show you the code:
Code:
<asp:Repeater id="rptProducts" runat="server">
<ItemTemplate>
<h8>
<b> <%# Container.DataItem ("ProductName")%></b>
<asp:Button id="btnNewPhase" runat="server" BackColor="Blue" ForeColor="White" Text="New Phase" Font-Size="XX-Small" Width="60px" ToolTip="Click this button to create a new phase for this product"></asp:Button>
</h8>
<asp:dataList ID="dlstPhases" Runat="Server" DataSource='<%# FilterPhases( Container.DataItem( "ProductID" ) )%>' RepeatColumns='5' RepeatDirection="Horizontal" CellSpacing="20">
<ItemTemplate>
<a href='<%# String.Format( "CDContentsEdit.aspx?id={0}&product={1}",Container.DataItem( "CDID" ),"Product Name") %>' > <%# Container.DataItem( "Phase" ) %> </a>
</ItemTemplate>
</asp:dataList>
</ItemTemplate>
</asp:Repeater>
What I'm trying to do is obtain the value of "ProductName" in rptProducts where the text is red inside dlstPhases. I've tried Parent.Container.DataItem() But that doesn't work. I can't seem to figure it out.
Any ideas?