Iterate through ASP.Net Ajax Tab Container ?

Discussion in 'ASP .Net' started by Luqman, Apr 25, 2008.

  1. Luqman

    Luqman Guest

    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, Apr 25, 2008
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:u%...
    >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\), Apr 26, 2008
    #2
    1. Advertising

  3. Luqman

    Luqman Guest

    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)" <> wrote in
    message news:eh6%...
    > 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" <> wrote in message
    > news:u%...
    >>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, Apr 27, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gogo
    Replies:
    1
    Views:
    2,107
    Sudsy
    Sep 4, 2003
  2. runescience
    Replies:
    0
    Views:
    1,464
    runescience
    Feb 9, 2006
  3. John
    Replies:
    4
    Views:
    926
    RedGrittyBrick
    Apr 1, 2008
  4. ton

    ajax tab container control

    ton, Apr 10, 2009, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    941
    Nanda Lella[MSFT]
    Apr 29, 2009
  5. Andrew Pollock
    Replies:
    1
    Views:
    110
    Captain Paralytic
    Sep 16, 2009
Loading...

Share This Page