19 Text Boxes Collection

Results 1 to 2 of 2

Thread: 19 Text Boxes Collection

  1. #1
    Join Date
    Dec 1969

    Default 19 Text Boxes Collection

    In an asp.net page, I have 19 text boxes. I want to capture what is entered in these boxes dynamically. Is there any way to iterate thru the collection and grab the values entered? Can it be done using arrays? <BR>Any help will be appreciated. Thanks.<BR>-hvirk

  2. #2
    Join Date
    Dec 1969

    Default RE: 19 Text Boxes Collection

    You can enumerate the controls on a page and inspect their type like so:<BR><BR>Dim ctl As Control<BR>Dim arrList As New ArrayList()<BR><BR>For Each ctl In Controls<BR> If TypeOf(ctl) Is Textbox Then<BR> arrList.Add(CType(ctl, Textbox))<BR> End If<BR>Next<BR><BR>If possible group your textboxes into a Panel first so that you are only enumerating the minimum number of controls - as opposed to every control on the page.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts