How to dynamically assign asp.net control ID's

Posted by Akk on Stack Overflow See other posts from Stack Overflow or by Akk
Published on 2010-05-10T10:20:30Z Indexed on 2010/05/10 10:24 UTC
Read the original article Hit count: 197

Filed under:

I want to do something like the following in an asp.net web form but get a Invalid Token error message:

<ul>
    <%foreach (var item in Items) {%>
    <li>
      <asp:TextBox ID="<%= item.Id  %>" runat="server" />
    </li>
    <%} %>
</ul>

What alternative methods are there to achieve the desired result?

© Stack Overflow or respective owner

Related posts about ASP.NET