Hi,
I have a AJAX tabcontainter with three tabpanels in my web page. Tabpanel1 has three labels (Label1/Label2/Label3). I would like reuse the following codes to dynamically find labels and make them invisible during first web site visit.
The below codes return "null" during debug step. I added a Label4 outside of the AJAX Tabcontainer and my codes found and made it invisible.
Please give me some tips. Regards. Hn
P.S. I actually comment out the // Label lbl = (Label)FindControl(labeltmp);
and tried the Label lbl = (Label)TabContainer1.FindControl(labeltmp);
Still doesn't work.
//disable label and image firstfor (int i = 1; i <= 10 ; i++) {
string labeltmp = "Label" + i.ToString(); string imagetmp = "Image" + i.ToString();
// Label lbl = (Label)FindControl(labeltmp);
Label
lbl = (Label)TabContainer1.FindControl(labeltmp); if (lbl != null ) { lbl.Visible = false;
}
}