I have an ASP.NET control that binds data to a relay. Inside this repeater, I have another user control. I want to pass a value to this second control based on the current binding element.
<asp:Repeater runat="server" ID="ProductList">
<ItemTemplate>
<p>Product ID: <%# Eval("ProductID") %></p>
<myControl:MyCoolUserControl runat="server" ProductID='<%# Eval("ProductID") %>' />
</ItemTemplate>
</asp:Repeater>
The repeater element template correctly prints my product identifier using the Eval operator, but when I do the same to pass the product identifier to MyCoolUserControl, it does not work (if the ProductID in MyCoolUserControl is Nullable Int32 - I can debug it and it always matters null).
Any ideas how I can do this?
source
share