Professional Web Applications Themes

Capturing Data of Dynamically Created TextBox's - ASP.NET General

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 ...

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

  3. #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

  4. #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

  5. #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

  6. #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

  7. #7

    Default Re: Capturing Data of Dynamically Created TextBox's

    i have a page consist of 3 butons. 1st button to dynamically create textboxes in a row of a table.
    2 nd button to cancel and 3 rd button to submit. how do i capture data on click of submit button
    mohd sajid Guest

Similar Threads

  1. Replies: 1
    Last Post: January 22nd, 03:58 AM
  2. Question capturing the value of dinamically created textfield
    By upeshk in forum Brainstorming Area
    Replies: 0
    Last Post: September 16th, 01:13 PM
  3. Replies: 0
    Last Post: December 8th, 09:32 AM
  4. using dynamically created Xml data for movieClipsresident on the Scene?
    By janussanders in forum Macromedia Flash Data Integration
    Replies: 1
    Last Post: November 6th, 06:12 PM
  5. Dynamically Created DG with TextBox ItemTemplates fails to fire OnTextChanged
    By Jean-Pierre Fouche in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: July 4th, 04:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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