protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { int i; Label lblBr; TextBox age1; TextBox age2; TextBox year1; TextBox year2; TextBox year3; TextBox year4; for (i = 1; i <= Convert.ToInt32(this.DropDownList1.SelectedItem.Value); i++) { age1 = new TextBox(); age2 = new TextBox(); year1 = new TextBox(); year2 = new TextBox(); year3 = new TextBox(); year4 = new TextBox(); age1.Width = 30; age2.Width = 30; year1.Width = 70; year2.Width = 70; year3.Width = 70; year4.Width = 70; age1.ID = "age1" + i; age2.ID = "age2" + i; year1.ID = "year1" + i; year2.ID = "year2" + i; year3.ID = "year3" + i; year4.ID = "year4" + i; lblBr = new Label(); lblBr.Text = "<br>"; this.panel.Controls.Add(age1); this.panel.Controls.Add(age2); this.panel.Controls.Add(year1); this.panel.Controls.Add(year2); this.panel.Controls.Add(year3); this.panel.Controls.Add(year4); this.panel.Controls.Add(lblBr); if (Convert.ToInt32(this.DropDownList1.SelectedItem.Value) >= 1) { this.panel.Visible = true; this.upload.Visible = true; } else { this.panel.Visible = false; this.upload.Visible = false; } } }
this.FindControl("control" + i);
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง