Iterate through ASP.Net Ajax Tab Container ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Luqman

    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.co ntrols
    if typeof ctrl is textbox then
    msgbox(ctype(ct rl,textbox).ID. ToString)
    end if
    next

    Any idea what am I missing ?

    Best Regards,

    Luqman



  • Cowboy \(Gregory A. Beamer\)

    #2
    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


    or just read it:


    *************** *************** *************** ****
    | Think outside the box!
    |
    *************** *************** *************** ****
    "Luqman" <pearlsoft@cybe r.net.pkwrote in message
    news:u%23FCA5xp IHA.548@TK2MSFT NGP06.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.co ntrols
    if typeof ctrl is textbox then
    msgbox(ctype(ct rl,textbox).ID. ToString)
    end if
    next
    >
    Any idea what am I missing ?
    >
    Best Regards,
    >
    Luqman
    >
    >
    >

    Comment

    • Luqman

      #3
      Re: Iterate through ASP.Net Ajax Tab Container ?

      Hi,

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

      You can check with the following code.

      Dim ctrl as new Control
      for each ctrl in me.tabpanel1.co ntrols
      msgbox (ctrl.gettype.t ostring)
      Next

      Best Regards,

      Luqman



      "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld @comcast.netNoS pamMwrote in
      message news:eh6%239m6p IHA.4884@TK2MSF TNGP06.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

      >
      or just read it:

      >
      *************** *************** *************** ****
      | Think outside the box! |
      *************** *************** *************** ****
      "Luqman" <pearlsoft@cybe r.net.pkwrote in message
      news:u%23FCA5xp IHA.548@TK2MSFT NGP06.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.co ntrols
      >if typeof ctrl is textbox then
      >msgbox(ctype(c trl,textbox).ID .ToString)
      >end if
      >next
      >>
      >Any idea what am I missing ?
      >>
      >Best Regards,
      >>
      >Luqman
      >>
      >>
      >>
      >
      >


      Comment

      Working...