Iterate through ASP.Net Ajax Tab Container ?

L

Luqman

I have a Ajax Tab Container on my Webform with One Panel and some Labels and
Textboxes.

I want to Iterate through all the textboxes and return their IDs.

I tried every possibility I could but I was unable to retrieve their IDs.

Here is my code, which returns nothing.

Dim ctrl as new Control
for each ctrl in me.tabpanel1.controls
if typeof ctrl is textbox then
msgbox(ctype(ctrl,textbox).ID.ToString)
end if
next

Any idea what am I missing ?

Best Regards,

Luqman
 
C

Cowboy \(Gregory A. Beamer\)

As you iterate look at the names of the controls. You may not be deep
enough. If I am correct, you will have to find the actual panel inside the
tab and iterate through its controls to get deep enough into the hierarchy.
 
L

Luqman

Hi,

For every control in Tab Panel, it just returns system.web.ui.control type,
why its not returning system.web.ui.textbox ?

You can check with the following code.

Dim ctrl as new Control
for each ctrl in me.tabpanel1.controls
msgbox (ctrl.gettype.tostring)
Next

Best Regards,

Luqman
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top