0

I am having issues with giving id to a text box in the aspx for

heres my code

  <%for (int i = 2; i <= 10; i++)%>
    <%  {%>
          <div id="divPerson<%= i %>">

        <label for="txtFirstNameFriend<%= i %>">Friends First Name</label>
        <asp:TextBox ID="txtFirstNameFriend<%= i %>" MaxLength="50" runat="server"></asp:TextBox>
        <br />
        <span id="ValFirstNameFriend<%= i %>" class="ValidationError" style="color:Red" visible="false" runat="server"><p>Please enter your First Name</p></span>
        <label for="txtLastNameFriend<%=i %>">Friends Last Name</label>
        <br />
        <label for="txtEmailAddressFriend<%= i %>">Friends Email Address</label>
        <asp:TextBox ID="txtEmailAddressFriend<%= i %>"  MaxLength="255" runat="server"></asp:TextBox>
        <div style="display:none"><asp:TextBox ID="ValFriend<%=i %>" CssClass="ValFriend<%= i %>" MaxLength="255" runat="server"></asp:TextBox></div>

    <br />

          </div>

     <% } %>

Is there any way of adding in a dynamic id to a textbox created on the aspx file?

1
  • You can write php in any language. Commented Mar 3, 2010 at 1:49

1 Answer 1

4

Have you seen the repeater control?

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.repeater.aspx

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.