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 608439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:27:42+00:00 2026-05-13T17:27:42+00:00

I am facing a strange behaviour for an .aspx page. I have DataList called

  • 0

I am facing a strange behaviour for an .aspx page.

I have DataList called MyDataList. I need to conditionally highlight the rows of the DataList, depending on an arbitrary value in the data, such as if a Date field is less then SomeDate.

I am using an UpdatePanel, ScriptManager and a timer (all AJAX) to refresh MyDataList.

protected void Timer1_Tick(object sender, EventArgs e)
{                
    MyDataList.DataBind();
}

protected void MyDataList_ItemCreated(object sender, DataListItemEventArgs e)
{
}

The Problem:

If I add an empty event handler for the ItemCreated event (EG, MyDataList_ItemCreated), it works fine (as shown above).

If I provide code to highlight the value in the ItemCreated event handler (as shown below), the Timer stops ticking, and the event Timer1_Tick does not fire any more.

protected void DataListBgArticles_ItemCreated(object sender, 
    DataListItemEventArgs e)
{
    if (e.Item.ItemType == ListItemType.Item || 
        e.Item.ItemType == ListItemType.AlternatingItem)
    {
        Product product = (Product)e.Item.DataItem;
        if (product.SaleDate > DateTime.Now.AddDays(-2))
        {
            e.Item.BackColor = Color.Pink;
        }
    }
}

How can I fix this so that the Timer continues to update?

  • 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-13T17:27:43+00:00Added an answer on May 13, 2026 at 5:27 pm

    Forgive the question, but I think you should specify exactly why you are performing a data binding operation in a timer callback in an ASP.NET page.

    There aren’t many (ok, any) situations I can think of which would require such a thing.

    The timer callback basically means you place the action outside of the page processing pipeline, and because of this, it’s completely possible that any objects that the code implicitly or explicitly depends on are no longer available.

    Because you are performing data binding, it’s completely possible that your timer event is firing and trying to update a grid which has already been pushed out to the user.

    It appears that you are using the timer to fire the event to update the data grid. The problem with this is that you are updating the structure on the server side, but it doesn’t equate an update on the client. The client needs to refresh itself in order to get this data (the server has no way of actually connecting to the client and refreshing).

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

Sidebar

Related Questions

I am facing a strange behaviour in jQuery 1.4 with the click event. The
In an site I'm currently writing, I'm facing a strange, mind-boggling behaviour: after seconds
I seem to be facing a strange issue in SQL 2008. I have a
I am facing a very strange problem. I have a grid and when i
I am facing strange issue on Windows CE: Running 3 EXEs 1)First exe doing
I have a public facing website that has been receiving a number of SQL
I am facing an unusual behaviour with the Repository and Transactions and its making
I am facing a strange error in MOSS 2007 running under Windows 2008. I
I'm facing very strange problem - my app is working nice on a device
I am facing a strange problem in cakePHP. The issue is when ever i

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.