How do I get Asp.net MVC BeginForm to add closing tag correctly?
- by Matt
I seem to be missing something obvious here, but cannot see what it is. My problem is that the closing form tag for BeginForm is not being added to my markup. I am looping through a collection and creating a form for each item, but the forms arent closing properly. Any suggestions please?
Thanks
<% foreach (var item in Model) { %>
<% using (Html.BeginForm("EditUser","Users"))
{ %>
<tr>
<td>
<input id="contactID" type="hidden" value="<%= item.ContactID %>" />
<%=item.Email %>
</td>
<td>
<%=item.Market.MarketName%>
</td>
<td>
<%=item.ContactType.ContactTypeName%>
</td>
<td>
<input type="submit" value="Edit" />
</td>
</tr>
<%} %>
<% } %>