Capturing Data of Dynamically Created TextBox's

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Capturing Data of Dynamically Created TextBox's

    Hi there,

    I am dynamically created a table at runtime on an aspx form. The last
    cell of each row contains a TextBox in which the user will enter
    numeric values into.

    Each textbox I create is given a name such as myTextBox0, myTextBox1,
    ... etc Basically the index of the loop that creates the table is
    appended to the end of each TextBox name (ID).

    My Problem:

    How do I capture the values in each text box once the user continues
    (click button) to the next screen??

    If you could possibily post me an example of how to do this I would be
    most grateful.

    Thanks in advance.
    Jack Johnston Guest

  2. Similar Questions and Discussions

    1. Managing ViewState of a dynamically created Custom Composite Server Control -(where the original is also dynamically created)
      Ok here's my scenario. I have a Custom Composite Server Control (CCSC) consisting of a TextBox, Button & Panel. (And some other code - which I...
    2. applying xsl to dynamically created xml
      I've been puzzling over this for hours. I hope someone here can help me out. I'm building a site that takes data from a MYSQL database and then...
    3. using dynamically created Xml data for movieClipsresident on the Scene?
      I am creating a virtual map of the united states. As some of you might know, it is easier to assemble all of the states right on the timeline than...
    4. Dynamically created user controls
      In ASP.Net, I am working with some in-house software that dynamically creates a form based on rows in a database table. For example, most pages...
    5. Access dynamically created controls
      Hi there, I read a lot about this issue but still got no clear answer that solves my problem. I've a Web User Control with a placeholder called...
  3. #2

    Default Re: Capturing Data of Dynamically Created TextBox's

    how do you move to the next page ?
    if you use Server.Transfer you can use the Form collection:
    Form["myTextBox0"]

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

  4. #3

    Default Re: Capturing Data of Dynamically Created TextBox's


    No I just have a button and within the button event I attempt to capture
    the values. Can you please be more specific?


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    John Johnston Guest

  5. #4

    Default Re: Capturing Data of Dynamically Created TextBox's

    On the same page ? by using the controls ID (just dont forget to
    recreate them on post back) and the FindControl method :

    string x = ((TextBox)this.FindControl("mytextbox1")).Text;



    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

  6. #5

    Default Re: Capturing Data of Dynamically Created TextBox's


    but on postback isn't everything recreated? so the values within the
    text box will be wiped?


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    John Johnston Guest

  7. #6

    Default Re: Capturing Data of Dynamically Created TextBox's

    Yes, every thing recreated but the asp.net smart enough to change the
    text box value to the value submitted from the client.

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139