Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. List controls in a web form

List controls in a web form

Scheduled Pinned Locked Moved ASP.NET
helpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Carlos Hochberg
    wrote on last edited by
    #1

    I am trying to list some controls (TextBoxes) in a web form. I tried using Collections, without success. Any help on this issue? Thanks! cghochberg

    D 1 Reply Last reply
    0
    • C Carlos Hochberg

      I am trying to list some controls (TextBoxes) in a web form. I tried using Collections, without success. Any help on this issue? Thanks! cghochberg

      D Offline
      D Offline
      Dr_X
      wrote on last edited by
      #2

      Not really sure as to what your asking for but as far as the control collections go, they're history in ASP.Net. If you wanted to use a collection to loop through controls then try the following.

      For i = 0 to 9
      Dim txtBox as TextBox = ctype(FindControl("TextBox" & i), TextBox)
      If not txtBox is nothing then
      'Do Something
      End if
      next i

      Now the above code is not tested so you may need tweak it but you should get the idea if looping through textboxes is what you are looking for. Michael I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)

      C 1 Reply Last reply
      0
      • D Dr_X

        Not really sure as to what your asking for but as far as the control collections go, they're history in ASP.Net. If you wanted to use a collection to loop through controls then try the following.

        For i = 0 to 9
        Dim txtBox as TextBox = ctype(FindControl("TextBox" & i), TextBox)
        If not txtBox is nothing then
        'Do Something
        End if
        next i

        Now the above code is not tested so you may need tweak it but you should get the idea if looping through textboxes is what you are looking for. Michael I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)

        C Offline
        C Offline
        Carlos Hochberg
        wrote on last edited by
        #3

        Thanks for the help! I did not receive a mail message, so I thought no one replied... I will keep you infomed about my progress and also if I find a solution. Regards, Carlos cghochberg

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups