You can go through the entire control hierarchy, but it is recursive, so you
have to check all containers for other controls (panels, etc.).
For each WebControl control in Container.Controls
Start with Container = Page.
You will also have to test each control to make sure it is a textbox, with
GetType().
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
*************************************************
Think outside of the box!
*************************************************
"Jl_G_0" <jl*********@gmail.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
Hey all.
I have to check the content of 20 textboxes on my Page_Load event, to
remove the string "nbsp;" from them.
I do it with:
If TextBox1.Text = "nbsp;" Then
TextBox1.Text = ""
End If
Works, but I have a lot of lines on my code... Is there any way to do
a FOR Loop to do this. The Texboxes names are TextBox1 to TextBox20, so
I thought I could use the folllowing command inside the FOR loop:
(Beofre the FOR: Dim i as Integer...)
If TextBox+i = "nbsp;" ' ERROR HERE how to make something like this
work ?
Hoep its possible to do that... thx.