Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>I ensure that my dynamic controls always have the same generated Control.ID</p> </blockquote> <p>ViewState are made regadless to control`s ID. If you want process OnClick event inside your dynamic control with inputed by user data, you have to restore the structure of your controls hierarchy before RaisPostBackEvent event, that fired right after Page_load.</p> <p>If you want to save your dynamic controls with the same state in other position on your page, or you want to have access to controls after creating other dynamic controls <strong>you HAVE TO save controls hierarchy</strong>.</p> <p>So! Create your first portion of dynamic controls in one container and create controls on postback in other container.</p> <p>For example on page request you render:</p> <pre><code>&lt; asp:placeholder id="iHaveToBeDuringAllRequests1" &gt; First dynamic cintrols &lt; /asp:placeholder &gt; &lt; asp:placeholder id="iHaveToBeDuringAllRequests2" &gt; Empty on first request &lt; /asp:placeholder &gt; </code></pre> <p>On PostBack you render:</p> <pre><code>&lt; asp:placeholder id="iHaveToBeDuringAllRequests1" &gt; First dynamic cintrols(you can clear or do not load these controls if you don't need it) &lt; /asp:placeholder &gt; &lt; asp:placeholder id="iHaveToBeDuringAllRequests2" &gt; Second dynamic controls load here &lt; /asp:placeholder &gt; </code></pre> <p>And last tip:</p> <blockquote> <p>I ensure that my dynamic controls always have the same generated Control.ID</p> </blockquote> <p>You need to ensure this for correct firing RaisPostBackEvent(OnClick etc.) by your dynamic controls(you can use INamingContainer container instead of placeholder).</p>
    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.
    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