Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You're right, it's all about the <strong>page lifecycle</strong>. Dynamically created controls must be re-created at the <code>Page_Init</code> stage, in order to exist <em>before</em> the viewstate binding stage. This means that will have to somehow (using the <code>Session</code>, maybe) store how many <code>textboxes</code> you have created on the previous processing to recreate them. Remind to use <strong>the same ID</strong> and to add them to your control tree (a repeater or something else that you're using).</p> <hr> <p><strong>UPDATE</strong></p> <p>Let me give you a suggestion: 1. Declare a class attribute of type <code>List&lt;TextBox&gt;</code> (let's call it <code>CreatedTextBoxes</code>)</p> <ol> <li><p>Declare a method that receives whatever it needs to create the textboxes. This method must not read anything outside of it's scope. It will simply receive some args, create the textboxes and add them to another control (such as a <code>Repeater</code>). Add each textbox created to <code>CreatedTextBoxes</code></p></li> <li><p>At the dropdown change event, read the option, save it to the <code>Session</code> and call this method</p></li> <li><p>At <code>Page_Init</code>, verify that object at the <code>Session</code>. If it's null or empty, don't do anything. If it has a value, call that same method, passing the same args</p></li> <li>When you need to retrieve that from the dynamically created textboxes, use <code>CreatedTextBoxes</code> and not <code>FindControls()</code></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload