M
MattB
I'm trying to build a repeater to generate text boxes based on a value in a
table. The number of boxes will vary so the repeater seemed like the logical
choice. I want to make the id property of each text box correspond to a
value in the datatable. I have the following which does not work (compile
errors). Can anyone tell me if this can be done, and if so what am I doing
wrong?
<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "Descrip")%>:
<asp:textbox id="<%#DataBinder.Eval(Container.DataItem, "Field")%>"
tabIndex="1" runat="server" Width="100px" MaxLength="30"></asp:textbox>
<br>
</ItemTemplate>
</asp:Repeater>
If I set a static id property(id="x"), it will compile and render the page.
Unfortunately that won't work for me. Any suggestions? TIA!
Mat
table. The number of boxes will vary so the repeater seemed like the logical
choice. I want to make the id property of each text box correspond to a
value in the datatable. I have the following which does not work (compile
errors). Can anyone tell me if this can be done, and if so what am I doing
wrong?
<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "Descrip")%>:
<asp:textbox id="<%#DataBinder.Eval(Container.DataItem, "Field")%>"
tabIndex="1" runat="server" Width="100px" MaxLength="30"></asp:textbox>
<br>
</ItemTemplate>
</asp:Repeater>
If I set a static id property(id="x"), it will compile and render the page.
Unfortunately that won't work for me. Any suggestions? TIA!
Mat