Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7367917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:35:53+00:00 2026-05-29T03:35:53+00:00

i have the following two objects public partial class ProgramObj { public int id;

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:35:54+00:00Added an answer on May 29, 2026 at 3:35 am

    Your ItemDataBound should work if you do this:

    PersonObj myPerson = ((ProgramObj)e.Item.DataItem).myPerson;
    lblUserName.Text = myPerson.full_name;
    

    Becausse the repeater is bound to a list of ProgramObj object the DataItem will be the ProgramObj. so you then need to get the myPerson property if you want the PersonObj object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following business objects: public abstract class Product { public int Id
I have following two entities public class User { public int UserId { get;
Given I have two File objects I can think of the following implementation: public
Suppose we have following two classes: class Temp{ public: char a; char b; };
I have the following Domain Object: public class DomainClass { public int Id {
Let's say I have following POJO's using Hibernate. public class User { private String
I have the following entity model: public class Project { [Key] public int ProjectID
I have the following code that creates two objects (ProfileManager and EmployerManager) where the
I have the following two tables: Customer { int Id int Name } Bills
I have the following two classes, one inherits from the other Class A{ void

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.