ListView shows duplicate items when the underlying shared list does not contain duplicate items

I am binding a shared list to <asp: ListView /> to display the tag cloud. The items in the list are tag-objects, where Tag is basically just something like:

public class Tag {
    public string Name { get; set; }
    public int Total { get; set; }
}

      

I create a List <Tag> object and then bind it to the ListView, but when the HTML is rendered for the page, some Tag objects are repeated for example. given the expected tag list of apple, banana, kiwi, orange, strawberry , the HTML actually outputs something like apple, banana, apple, apple, strawberry .

I am writing the contents of my base <Tag> to Trace.axd and this shows the elements are in the correct order without duplicates.

Has anyone come across something similar?

+1


source to share


1 answer


Could you add some more code? Perhaps you are using some reference variables that share the same memory location? It's hard to tell with the code you downloaded.



+1


source







All Articles