<% foreach (var item in Model.DefectCodes) { %>
<tr>
<% using (Ajax.BeginForm("Create", new AjaxOptions() ))
{%>
<!--should be easy like this!--><!--ur codeid here-->
<%=Html.HiddenFor(modelItem => item.codeid)%>
<td>
<%= Html.Encode(item.Code)%>
</td>
<td>
<%= Html.Encode(item.Description)%>
</td>
<% Html.RenderPartial("Create",null, ViewData); %><!-- This is where the form is -->
<% } %>
</tr>
<% } %>
</table>
它只是解决你隐藏的价值!问题。。
你不需要把它放进一个
TD
因为你希望它被隐藏,所以它仍然会得到你的值,但不会显示在窗体、表或视图中。。这样你就可以保留3个
TD公司
得到比表上显示的更多的值。