Hello I have a DataList that has four lables and they all end with a number 1-4. In my code behind I have a for loop and an array that I want to set the labels of
DataList
You can use this code - based on string.Format("....{0}",arguments)
string.Format("....{0}",arguments)
var control = (Label)item.FindControl(string.Format("lbl{0}",y));
I suggest you to use DataList.ItemDataBound
DataList.ItemDataBound
Link : http://msdn.microsoft.com/fr-fr/library/system.web.ui.webcontrols.datalist.itemdatabound.aspx