-1
我创建了添加/删除列表项的视图。我试图处理添加/删除动态,但我不清楚如何获得正确的模板上下文时,清单是空的。空列表的模板/数据/模型上下文ASP.NET MVC2
的观点是基于:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Service.Cms.ListItems;
namespace Bcp.Service.Cms.Documents
{
public class Tasting //: Document
{
public Tasting() { }
public List<DocumentListItem> relatedCrap { get; set; }
}
}
相关货品看起来是这样的:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Service.Cms.ListItems
{
public class DocumentListItem
{
public DocumentListItem() { }
public Int32 documentId { get; set; }
public String title { get; set; }
public String documentType { get; set; }
public String status { get; set; }
}
}
为了保存列表项,每个属性都需要与tastingInfo.relatedDocs.#PROPERTYNAME#
前缀 但如果列表为空时,我加载视图,我不知道如何访问该上下文。任何人有任何想法?