simple question: Difficulty in declaring and using variable

Posted by user281180 on Stack Overflow See other posts from Stack Overflow or by user281180
Published on 2010-06-16T11:52:00Z Indexed on 2010/06/16 12:02 UTC
Read the original article Hit count: 135

Filed under:

What is wrong with the following code: I`m having the error message

Error 1 ; expected

    <%if (Model.ReferenceFields != null)
          {%>
            <%int count = 1; %>

            <%foreach (var referenceName in Model.ReferenceFields)
            {%>
             <%var value = "value"; %>
             <%count++; %>
             <%value = value + count.ToString(); %>
            <tr>
                <td><input type="hidden" name="Tests.Index" value='<%value%>' /></td>
                <td><input type="text" name="Tests['<%value%>'].Value"/></td>
                <td><input type="button" value= "Add" /></td></tr>
            <%}
               %>
         <%}
        %>

© Stack Overflow or respective owner

Related posts about asp.net-mvc