C# 模型绑定到列表-如何处理插入
我指的是Phil Haack的这篇文章,我需要做同样的事情,但是如果我需要在列表中插入记录,在我想要的任何索引处呢?在不使用Javascript和更新所有索引的情况下,如何保持索引的同步C# 模型绑定到列表-如何处理插入,c#,asp.net-mvc,asp.net-mvc-2,list,binding,C#,Asp.net Mvc,Asp.net Mvc 2,List,Binding,我指的是Phil Haack的这篇文章,我需要做同样的事情,但是如果我需要在列表中插入记录,在我想要的任何索引处呢?在不使用Javascript和更新所有索引的情况下,如何保持索引的同步 <form method="post" action="/Home/Create"> <input type="text" name="[0].Title" value="Curious George" /> <input type="text" name="[0].Author
<form method="post" action="/Home/Create">
<input type="text" name="[0].Title" value="Curious George" />
<input type="text" name="[0].Author" value="H.A. Rey" />
<input type="text" name="[0].DatePublished" value="2/23/1973" />
<input type="text" name="[1].Title" value="Code Complete" />
<input type="text" name="[1].Author" value="Steve McConnell" />
<input type="text" name="[1].DatePublished" value="6/9/2004" />
<!-- I want to insert a record here by adding the fields through JavaScript -->
<input type="text" name="[2].Title" value="The Two Towers" />
<input type="text" name="[2].Author" value="JRR Tolkien" />
<input type="text" name="[2].DatePublished" value="6/1/2005" />
<input type="submit" />
我不太明白我将如何使用那篇博文中描述的“非顺序索引”来做一些事情,比如将记录插入到特定的索引中
有什么想法吗