When you look thru the controls collection of the page, you will almost always get 3 controls. Here are those controls:
1. All the literal text before the <form> tag,
2. The <form> tag
3. All the literal text after the <form> tag (</form>)
All the controls that fall between the <form> and </form> tags are contained within the form control and can be found in its controls collection. The same applies for any control that lives within another controls, such as controls in an asp:placeholder.
You will need to write a recursive function that digs down into each child control. Simply test for more controls within the control that is being handled and keep going until you reach a controls collection that is empty. You could pass a control or a controls collection into the function, doesn't matter which.
If you need help with this recursive function, post back and we can help some more.
Peter
------------------------------------------------------
Work smarter, not harder.
|