Programing and Manipulating the .Net ListItem

Posted by Elliott Nash | Filed under , , , ,

How to use .Net ListItem in the real world

When starting out with .Net the built-in server controls can appear a bit daunting - especially if coming from a classic ASP or PHP background (where you simply write HTML elements out as a string). In this post i will run through an every day example of how to use a ListItem to display data and customise the output via the ItemTemplate.

A .Net ListItem can be used to bind data from a datasource (SQLDataReader, DataTable, ArrayList, GenericList etc...) to display to the end user. The display can be customised through the use of the <itemTemplate> as follows: More...