Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I agree that it looks like you are adding the same Control over and over which causes a naming conflict. It also looks like you may be adding controls to other controls' Controls collections in the wrong order. For example, you are adding in this order:</p> <pre><code>TableHeaderRow h = new TableHeaderRow(); TableHeaderCell hc1 = new TableHeaderCell(); hc1.Text = "Item Description"; h.Cells.Add(hc1); TableHeaderCell hc2 = new TableHeaderCell(); hc2.Text = "Item Price"; h.Cells.Add(hc2); TableHeaderCell hc3 = new TableHeaderCell(); hc3.Text = "Item Quantity"; h.Cells.Add(hc3); TableHeaderCell hc4 = new TableHeaderCell(); hc4.Text = "Item Sub Total"; h.Cells.Add(hc4); Table1.Rows.Add(h); </code></pre> <p>When you should really be adding in this order:</p> <pre><code>TableHeaderRow h = new TableHeaderRow(); Table1.Rows.Add(h); TableHeaderCell hc1 = new TableHeaderCell(); h.Cells.Add(hc1); hc1.Text = "Item Description"; TableHeaderCell hc2 = new TableHeaderCell(); h.Cells.Add(hc2); hc2.Text = "Item Price"; TableHeaderCell hc3 = new TableHeaderCell(); h.Cells.Add(hc3); hc3.Text = "Item Quantity"; TableHeaderCell hc4 = new TableHeaderCell(); h.Cells.Add(hc4); hc4.Text = "Item Sub Total"; </code></pre> <p>As a rule, I always try to add a new control to the parent Controls collection as soon as possible to ensure that any child controls inherit the correct UniqueID. If you create a new Control X and start adding to X.Controls BEFORE adding X to the parent Controls collection then the child controls may not inherit the right UniqueID.</p>
 

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