i have the following two objects
public partial class ProgramObj
{
public int id;
public PersonObj myPerson;
}
public class PersonObj
{
public int id;
public string full_name;
}
I am assigning a list of ProgramObj's to a repeater from a SqlDataReader
program_list.DataSource = reader;
program_list.DataBind();
What I want to do, is access the full_name property of the PersonObj in each ProgramObj I've tried multiple things, the only thing that gets me an output value is
<%# DataBinder.Eval(Container.DataItem, "id") %>
which gets me the id of the ProgramObj, but I would like to get the name of the PersonObj, I thought
<%# DataBinder.Eval(Container.DataItem, "myPerson.full_name") %>
would work, but it doesn't appear to get me anywhere.
I also tried an ItemDataBound with
PersonObj myPerson = (PersonObj)e.Item.DataItem;
lblUserName.Text = myPerson.Full_Name_RFL;
and
<%# DataBinder.Eval(Container.DataItem, "myPerson") %>
but i get an error that it cannot cast an object of type DataRecordInternal to PersonObj. thoughts?