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

  • Home
  • SEARCH
  • 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 6253615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:01:58+00:00 2026-05-24T14:01:58+00:00

Using a repeater to data bind a common control we are having issues where

  • 0

Using a repeater to data bind a common control we are having issues where the data bound control is not being bound in different environments.

The old works on my machine issue.

We have the below repeater:

<web:Repeater ID="rptVehicles" runat="server" DataType="Entities.VehicleSummary" OnItemDataBound="rptItemList_OnItemDataBound">
<ItemTemplate>
    <div style="display:none">  
        <p>Container Item = <%# (Container.DataItem == null) ? "null" : "not null" %></p>
        <p>Container Item Id = <%# (Container.DataItem.ID == null) ? "null" : "not null" %></p>
        <p>Container Item Id = <%# Container.DataItem.ID %></p>
    </div>
    <common:VehicleItem runat="server" ID="itmVehicle" DataSource="<%# Container.DataItem %>" ImageDefinition="<%# this.ImageDefinition %>"  />
</ItemTemplate>
</web:Repeater>

And the contents of the Vehicle Item user control:

<div class="m-vitem">
<div style="display:none">
    <p>DataSourceSet = <%# this.DataSourceSet %></p>
    <p>Item DataSource = <%# (this.DataSource == null)? "null" : "not null" %></p>
</div>

On local the data source setter gets called passing in the Vehicle Summary entity.

DataSourceSet property is set to true in the DataSource property setter, on local its output is true on testing its false.

We are using different .Net versions on local and testing environments, does anyone know if there are any difference in the data bind handling between versions and what can be done, or am I barking up the wrong tree?

LOCAL – Microsoft .NET Framework Version:2.0.50727.4961; ASP.NET Version:2.0.50727.4955
TESTING- Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082

  • 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-24T14:01:58+00:00Added an answer on May 24, 2026 at 2:01 pm

    It looks like the code in your base property that was performing the set up was not being called since the overriding property on your vehicles entity. Marking a base property as virtual only makes the compiler choose which version of the property it needs to use at run-time. It does not mean that the base property setter’s code is run before/after the sub class` property setter.

    Also, it doesn’t make sense to actually do any ‘set up’ in a property, you’d ideally want to move that to the base constructor, where it would be executed if you call your base constructor from your object’s constructor. Alternatively but less ideally, you could perform the set up in your overriding property as well.

    Moving the set up code to OnDataBinding works for you since the DataBind event is fired automatically whenever you set the DataSource property of the repeater.

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

Sidebar

Related Questions

HI, I'm having a Repeater bound to a ObjectDataSource. I retrieve my data using
I'm using the Repeater control on my site to display data from the database.
I am trying to bind data from SQL to a repeater control. I have
I'm using a repeater control and I'm trying to pass a parameter as such:
It's easy to bind a data source to something like a gridview or repeater,
I had Repeater which bind method this method retrieve data from data base by
I am trying to place a repeater within a repeater using xml data. I
Using VS 2008, I have a Repeater control: <asp:Repeater runat=server ID=storesRep DataSourceID=storeSqlDataSource OnItemDataBound=StoresRep_ItemDataBound> <ItemTemplate>
Existing code is using an asp:repeater to build an HTML table. (emphasis on the
A table row is generated using an asp:Repeater: <asp:repeater ID=announcementsRepeater OnItemDataBound=announcementsRepeater_ItemDataBound runat=Server> <itemtemplate> <tr

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.