page controls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,
Where does asp.net stores the objects declared in the page.
I have a method where I want to loop through all the controls(textbox, HtmlInputText) within the page.
I want to in which collection these (textbox,HtmlInputText) are stored

thanks in advance..
das
 
this.Controls

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "


Das said:
Hi All,
Where does asp.net stores the objects declared in the page.
I have a method where I want to loop through all the controls(textbox,
HtmlInputText) within the page.
 
Hi Das,


First of all if you want to validate the controls in the page you better
use the mechanism present in ASP.NET for that, believe me it's MUCH more
flexible that what you are doing.

Now to iterate in ALL the controls present in a page you start with
Page.Controls , and for each of the controls you find you have to check its
own Controls collection , remember that there are several controls ( Panel,
PlaceHolder, etc) that contains other controls. They are designed using the
composite pattern.

Cheers,
 
Back
Top