I've created a view for adding/removing items for a list. I'm trying to handle adding/removing dynamically, but I'm unclear on how to get the proper template context when the list is empty.
The view is based on:
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; }
}
}
Related List Item looks like this:
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; }
}
}
In order to save the list items, each of the properties will need to be prefixed with tastingInfo.relatedDocs.#PROPERTYNAME#
but if the list is empty when I load the view, I don't know how to access that context. Anybody have any ideas?