grobech
پنج شنبه 18 شهریور 1389, 10:21 صبح
سلام اقا من چند تا کنترل درون PlaceHolder میریزم اینجوری :
Dim a, b As Integer
If IsNumeric(Val(TextBox1.Text)) Then
b = Val(TextBox1.Text)
End If
For a = 1 To b
Dim objfile As FileUpload = New FileUpload
objfile.ID = a
PlaceHolder1.Controls.Add(objfile)
Next
بعد که می خوام دسترستی به کنترل داشته باشم اصلا پیداش نمی کنه اینجوری :
For Each objfile As Control In PlaceHolder1.Controls
If TypeOf objfile Is FileUpload Then
Label1.Text = objfile.ID
End If
Next
حتی تعدادم صفر میزنه اینجوری :
Label1.Text = PlaceHolder1.Controls.Count
ممنون میشم منو راهنمایی کنید.
Dim a, b As Integer
If IsNumeric(Val(TextBox1.Text)) Then
b = Val(TextBox1.Text)
End If
For a = 1 To b
Dim objfile As FileUpload = New FileUpload
objfile.ID = a
PlaceHolder1.Controls.Add(objfile)
Next
بعد که می خوام دسترستی به کنترل داشته باشم اصلا پیداش نمی کنه اینجوری :
For Each objfile As Control In PlaceHolder1.Controls
If TypeOf objfile Is FileUpload Then
Label1.Text = objfile.ID
End If
Next
حتی تعدادم صفر میزنه اینجوری :
Label1.Text = PlaceHolder1.Controls.Count
ممنون میشم منو راهنمایی کنید.