oracleguy
07-09-2003, 09:37 PM
I have a problem with retriving values from controls in asp .net
Here is the 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>
I'm trying to obtain the value of the data item "ProductName" from rptProducts and insert it where the red text is. However I can figure out how to obtain values from controls higher up.
Any ideas?
Here is the 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>
I'm trying to obtain the value of the data item "ProductName" from rptProducts and insert it where the red text is. However I can figure out how to obtain values from controls higher up.
Any ideas?