开发者

problems with bulk editing in MVC 2 C#

开发者 https://www.devze.com 2023-01-18 20:04 出处:网络
I开发者_Go百科m having issues when trying to post a IList back to the controller here is some of the code

I开发者_Go百科m having issues when trying to post a IList back to the controller here is some of the code

My controller

public ActionResult Approvals(ICollection<ApprovalListModel> model) {

My pages <%@ Page Inherits="ViewPage<IList<Book>>" %>

<% for (int i = 0; i < ViewData.Model.Count; i++) { %>

<%: Html.TextBoxFor(m => m[i].Title) %>...

But when it posts back it only ever returns the first item and missing data as well


Found the issue i was incrementing i twice so the sequence was out of wack wen 0 2 4 6 8 so it would only bring back 0 :-S

0

精彩评论

暂无评论...
验证码 换一张
取 消