I have an order page that is being rendered from a Model object (Order) with a few properties. One of the properties of the Order object is
public List<OrderItem> Items { get; set; };
and the other is
public List<OrderComment> Comments { get; set; };
My main page is declared like this:
public class OrderView : ViewPage<Order>
I want to have a User Control for each OrderItem (named OrderItemControl), and another User Control for each OrderComment (named OrderCommentControl). If I could use a repeater for each collection then that would be great, but I am running into a problem. I want my user control declarations to looks like this:
public class OrderItemControl : ViewUserControl<OrderItem>
public class OrderCommentControl : ViewUserControl<OrderComment>
I get an error when I try to do this saying:
{"The model item passed into the dictionary is of type 'Order' but this dictionary requires a model item of type 'OrderItem'."}
I am guessing repeater might not be the right way to go, but I really want each User Control to have a model of type OrderItem or OrderComment, and not just Order.