Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to FindControl on Page which is added dynamically from UserControl
    primarykey
    data
    text
    <p>Actually, I am adding <code>UserControl</code> which is having <code>TextBox</code> and <code>ComboBox</code> to a Panel on my Page. Now, I need to show some text in the <code>TextBox</code> by Finding the Control.</p> <p>My UserControl:</p> <pre><code>&lt;table cellpadding="2" cellspacing="2" style="border: 1px solid black;"&gt; &lt;tr&gt; &lt;td&gt;Name &lt;/td&gt; &lt;td&gt; &lt;dx:ASPxTextBox ID="Txt_Image_text" runat="server" Width="170px"&gt; &lt;ValidationSettings&gt; &lt;RequiredField ErrorText="Please Enter Name" IsRequired="True" /&gt; &lt;/ValidationSettings&gt; &lt;/dx:ASPxTextBox&gt; &lt;/td&gt; &lt;td&gt;Image &lt;/td&gt; &lt;td&gt; &lt;dx:ASPxComboBox ID="Cmb_Image_Upload" runat="server" ValueType="System.String" TextField="IMAGENAME" ValueField="ID"&gt; &lt;ValidationSettings&gt; &lt;RequiredField ErrorText="Please Select an Image" IsRequired="true" /&gt; &lt;/ValidationSettings&gt; &lt;/dx:ASPxComboBox&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>I am Adding Controls through :</p> <pre><code>private void LoadImageControls() { for (int i = 0; i &lt; int.Parse(ViewState[VIEWSTATEKEY].ToString()); i++) { Panel_Image_Multimedia.Controls.Add(LoadControl("~/DynamicControls.ascx")); } } </code></pre> <p>I am trying to find the Control in this way :</p> <pre><code>ASPxPanel obj = (ASPxPanel)Panel_Image_Multimedia.FindControl("Txt_Image_text"); </code></pre> <p>But, I am getting <code>Null</code> for <code>obj</code>.</p> <p>Is it Possible to access them through <code>UniqueID</code> ?</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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