I have created a list of user controls that use the same interface to populate the data fields in each card depending on what the data object's label is. The problem I am running into is I don't know how to display this collection of objects in the html page.
var compiledList = new List<ICard>();
foreach (DataResult entityObject in entityList)
{
switch (entityObject.Label)
{
case "Employee":
//create control as ICard
ICard usrControl = new empsumCardUserControl(entityObject) as ICard;
((ICard)usrControl).Populate();
compiledList.Add(usrControl);
break;
}
}
How do I display the compiledList in a formatted section of my HTML page?
The solution was to use a place holder in the HTML and create an instance of the user control to load it in the code behind, and then add it to the placeholder.