How to create loop for changing Lable[ID] in asp.net using c#? -


i want create loop changing lable[id].

label1.text = multiarray[rowcount - 1, 1];  label2.text = multiarray[rowcount - 1, 2];  label3.text = multiarray[rowcount - 1, 3]; 

please give me code solve problem.

for(int index = 1; index <= 3; index ++) {     label label = (label)this.controls.find("label" + index, false)[0];     label.text = multiarray[rowcount - 1, index];  } 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -