Note that there are some explanatory texts on larger screens.

plurals
  1. POFind control values in markup, created with a Repeater, from code-behind
    primarykey
    data
    text
    <p>I think I may have used a repeater when I should have used something else, so I'm ready to chalk this up to design but I wanted to check with the development community before changing this.</p> <p>I should also say upfront that I'm using this repeater control within a custom user-control for an aspx page.</p> <p>My situation is that I have to dynamically display a list of additional parts when a user selects an item. This is similar to an "you might also be interested in" list that you sometimes see during an online checkout.</p> <p>So the user selects an item to order from a dropdown and up to 4 additional parts can be optionally added.</p> <p>Currently I'm bringing back that optional part list in a generic list of data-objects and binding it to a repeater control and its textboxes. The textboxes basically list a part description in one box and an option for the user to type in a quantity of how many they want of that item in another textbox.</p> <p>That all works great.</p> <p>So to be clear, after the repeater control loads everything and the form is rendered, the users can then type in values in the quantity textboxes.</p> <p>Since this is all in a user-control, I'm writing a method to gather all this information up, populate a business object and return it to whatever calls it.</p> <p>I'm having trouble finding the auto-generated textboxes so I can retrieve their values.</p> <p>I have this sneaking suspicion that I'm doing something obviously wrong in my design. So I wanted to run this by the hive-mind to see what others think :)</p> <p>Here is my markup generated by the repeater control.</p> <pre><code>&lt;div class="base-container-controls-75pct"&gt; &lt;div class="base-container-controls-98pct"&gt; &lt;div class="base-container-controls-75pct"&gt; &lt;input name="DownLoadItem1$UxAdditionalParts$ctl01$UxItemNumber" type="text" id="DownLoadItem1_UxAdditionalParts_ctl01_UxItemNumber" class="textbox-readonly-xl" /&gt; &lt;/div&gt; &lt;div class="base-container-controls-10pct"&gt; &lt;input name="DownLoadItem1$UxAdditionalParts$ctl01$UxQuantity" type="text" value="3" id="DownLoadItem1_UxAdditionalParts_ctl01_UxQuantity" class="textbox-md" /&gt; &lt;/div&gt; &lt;/div&gt; ... more repeating code here, basically the 98pct div above is repeated for each "row" ... &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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