I have a datalist with 2 columns of products with a TextBox next to each product so my customer can enter a number in each checkbox (to determine the order sequence when this list of products is printed to the screen). I have a button for my customer to click when she is happy with the sequence chosen for each product and this calls a subroutine within which I need to be able to collect each productID and the number entered into the textbox next to it. This worked perfectly in my old system using Classic ASP and can't understand why it's so difficult to offer the same funtionality in ASP.Net! I have tried various approaches but none of them work in collecting the number entered into the TextBox and the ProdId at the same time. I tried storing the ProductId in the ID of the TextBox in the hope that I could then retrieve both the ProductId and the value of the TextBox for each product when the button is clicked but values of the TextBox ID are values such as 567 or 784 and are set dynamically (these are the productIds). The error I'm getting is as follows:
The ID property of a control can only be set using the ID attribute in the tag and a simple value. Example: <asp:Button runat="server" id="Button1" />
and the line containing the error is:
<asp:TextBox runat="server" ID='<%# DataBinder.Eval(Container.DataItem, "Prod_ID")%>' Text='<%# DataBinder.Eval(Container.DataItem, "Sequence1")%>'></asp:TextBox>
Any advice would be greatly apreciated.
Thanks, Lorna
The ID property of a control can only be set using the ID attribute in the tag and a simple value. Example: <asp:Button runat="server" id="Button1" />
and the line containing the error is:
<asp:TextBox runat="server" ID='<%# DataBinder.Eval(Container.DataItem, "Prod_ID")%>' Text='<%# DataBinder.Eval(Container.DataItem, "Sequence1")%>'></asp:TextBox>
Any advice would be greatly apreciated.
Thanks, Lorna