I have the following code:

```
<% foreach (var orderDetail in Model.OrderDetails) { %>
    <div><%= Html.LabelFor( x => orderDetail.DateOfBirth)%></div>
    <div><%= Html.TextBoxFor(x => orderDetail.DateOfBirth) %></div>
<% } %>

```

The info is being displayed, however, I can't click on the label and go to the text box because the ID attribute is being repeated due to the foreach loop.

```
<label for="orderDetail_DateOfBirth">DateOfBirth</label>
<input type="text" value="" name="orderDetail.DateOfBirth" id="orderDetail_DateOfBirth">

```

Does anyone know how to fix this?

**UPDATE:** 

I ended up doing it this way since UpdateModel() didn't work either, any thoughts?

```
<% 
    int i = 0;
    foreach (var orderDetail in Model.OrderDetails) { %>

        <div><label for="DateOfBirth_<%=i %>_">Date of Birth</label></div>
        <div><%= Html.TextBox("DateOfBirth[" + i + "]", orderDetail.DateOfBirth) %></div>

<% i++
   } %>

```