I am binding a generic List to an <asp:ListView /> control to display a tag cloud. The elements 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 the List<Tag> object and then bind it to a ListView but when the HTML is rendered for the page certain Tag objects are repeated e.g. given the expected tag list of apple, banana, kiwi, orange, strawberry the HTML would actually output something like apple, banana, apple, apple, strawberry.
I am writing out the contents of my underlying List<Tag> to the Trace.axd and that shows the elements to be in the correct order without duplicates.
Has anyone ever come across something similar?