Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Iterate through ASP.Net Ajax Tab Container ? (http://www.velocityreviews.com/forums/t607649-iterate-through-asp-net-ajax-tab-container.html)

Luqman 04-25-2008 09:46 PM

Iterate through ASP.Net Ajax Tab Container ?
 
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




Cowboy \(Gregory A. Beamer\) 04-26-2008 02:28 PM

Re: Iterate through ASP.Net Ajax Tab Container ?
 
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.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
"Luqman" <pearlsoft@cyber.net.pk> wrote in message
news:u%23FCA5xpIHA.548@TK2MSFTNGP06.phx.gbl...
>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
>
>
>




Luqman 04-27-2008 06:55 AM

Re: Iterate through ASP.Net Ajax Tab Container ?
 
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



"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in
message news:eh6%239m6pIHA.4884@TK2MSFTNGP06.phx.gbl...
> 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.
>
> --
> Gregory A. Beamer
> MVP, MCP: +I, SE, SD, DBA
>
> Subscribe to my blog
> http://gregorybeamer.spaces.live.com/lists/feed.rss
>
> or just read it:
> http://gregorybeamer.spaces.live.com/
>
> *************************************************
> | Think outside the box! |
> *************************************************
> "Luqman" <pearlsoft@cyber.net.pk> wrote in message
> news:u%23FCA5xpIHA.548@TK2MSFTNGP06.phx.gbl...
>>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
>>
>>
>>

>
>






All times are GMT. The time now is 02:31 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.