If u want to assign Datalist item count then write the following code in ItemDataBound of Datalist protected void Datalist1_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
if (dd.Tables[0].Rows.Count > 0)
{
Label id = e.Item.FindControl(“lblId”) as Label;
int auto = e.Item.ItemIndex + 1;
id.Text = ” Item ” + auto.ToString();
}
}
}
This Code will find the Lable in Datalist and Assign it Auto number.
Hi my loved one! I wish to say that this
article is awesome, nice written and include approximately all significant infos.
I would like to peer extra posts like this .