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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:51:57+00:00 2026-05-21T08:51:57+00:00

I have a ListView control which I used to populate using an ASP ObjectDataSource

  • 0

I have a ListView control which I used to populate using an ASP ObjectDataSource control. This worked fine.

However, I wanted to implement a filter that showed items in the ListView that began with the letter A, B, C, etc. To do this, I removed the ObjectDataSource control and replaced it with some code in the Page_Load event allowing me greater control over what I was passing in as the data source, similar to this:

System.Diagnostics.Debug.Print("{0:HH:mm:ss} : GET DATA", DateTime.Now);
List<MyItem> items = GetItems("A"); // Gets a list of items with a description that 
                                    // begins with A
MyListView.Datasource = items;
System.Diagnostics.Debug.Print("{0:HH:mm:ss} : BIND DATA", DateTime.Now);
MyListView.DataBind();
System.Diagnostics.Debug.Print("{0:HH:mm:ss} : DONE", DateTime.Now);

Output (times are representative of actual results):

16:00:00 : GET DATA
16:00:00 : BIND DATA
16:00:20 : DONE

Since doing this, it takes about 20 seconds to load the page in my browser, instead of around 1 second when I used the ObjectDataSource.

To load the data into my ListView rows, I use the standard <%# Eval("Description") %> method. After some searching on SO and google, some people seem to say that Eval is inefficient.

Why does manual binding in the Page_Load event slow everything down? Is it because Eval is inefficient? How can I speed it up, and what is the correct way to do this?

  • 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-21T08:51:58+00:00Added an answer on May 21, 2026 at 8:51 am

    It seems highly unlikely to me that the problem is the Eval statement or the the fact that you’re databinding in the page load unless your returning a very very large list. Eval may be slower but not by the amount you are seeing. There is probably another cause.

    I would double check the GetItems() function. It’s more likely that the selection code is somehow less efficient than it could be.

    Additional things to check…

    Check the properties Eval is calling. Does they do something more that just return a string? Eval will run whatever code is within those properties/methods so make sure they are as fast as possible.

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

Sidebar

Related Questions

I have a ListView control that is in FullRowSelect mode, MultiSelect off and using
The ASP.NET ListView control like most databound ASP.NET controls has an AlternatingItemTemplate which you
In an ASP:ListView control, I have a checkbox for each row. Each row represents
I have a WPF ListView control for which I am dynamically creating columns. One
I have a user control which is having a listview inside it. The SelectionChanged
I have a Jquery dialog with an ASP listview control inside. Before showing the
I have a list view control which at the moment only allows one item
I have a ListView control, and I'm trying to figure out the easiest/best way
Can you have a multicolumn listview control where one of the columns is a
I have a ListView which sometimes I need to put around 10000 items in.

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.