page controls

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
 
T

Tamir Khason

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.
 
I

Ignacio Machin \( .NET/ C# MVP \)

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top