System.Web.UI.WebControls Namespace DataListItem Class
Returns the type of an item in a DataList control.
Script |
[ ListItemType variable = ] DataListItem.ItemType |
The property is read only with no default value.
Use the ItemType property to determine the type of a DataListItem in a DataList control.
The following example demonstrates how to use the ItemType property to determine the type of an item in a DataList control. The order in which the items are positioned in the DataList is displayed along with the item type.
foreach ( DataListItem item in myDataList.Items ) {
msg.Text += "<br>" + item.ItemIndex + " " + item.ItemType;
}
dim item as DataListItem
for each item in myDataList.Items
msg.Text &= "<br>" & item.ItemIndex & " " & item.ItemType
next |
|
C# |
VB |
Show me
Below are links to further code examples that demonstrate use of the ItemType property in practical ASP.NET applications.
DataListItem Members ItemIndex