Why don't you try it out?? ;)
Yes, that would work. FindControl expects the name of the control as a string, so combining the fixed "tb" with the number should work.
However, there are a few issues with the current code. First of all, you probably need to cast the control returned by FindControl to a real text box:
Code:
Dim i As Integer
Dim myTxtBox As TextBox
For i = 1 To 5 'suppose i have 5 textboxes "tb1", "tb2"..."tb5"
myTxtBox = CType(myplaceHolder.FindControl("tb" & i.ToString()), TextBox)
Next
Second, you can't Response.Write the TextBox to get its text; you'll need to explicitly use its text property:
Code:
Response.Write(myTxtBox.Text)
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.