0

Actually, I am adding UserControl which is having TextBox and ComboBox to a Panel on my Page. Now, I need to show some text in the TextBox by Finding the Control.

My UserControl:

<table cellpadding="2" cellspacing="2" style="border: 1px solid black;">
    <tr>
        <td>Name
        </td>
        <td>
            <dx:ASPxTextBox ID="Txt_Image_text" runat="server" Width="170px">
                <ValidationSettings>
                    <RequiredField ErrorText="Please Enter Name" IsRequired="True" />
                </ValidationSettings>
            </dx:ASPxTextBox>
        </td>
        <td>Image
        </td>
        <td>
            <dx:ASPxComboBox ID="Cmb_Image_Upload" runat="server" ValueType="System.String" TextField="IMAGENAME" ValueField="ID">
                <ValidationSettings>
                    <RequiredField ErrorText="Please Select an Image" IsRequired="true" />
                </ValidationSettings>
            </dx:ASPxComboBox>

        </td>
    </tr>
</table>

I am Adding Controls through :

private void LoadImageControls()
        {
            for (int i = 0; i < int.Parse(ViewState[VIEWSTATEKEY].ToString()); i++)
            {
                Panel_Image_Multimedia.Controls.Add(LoadControl("~/DynamicControls.ascx"));
            }
        }

I am trying to find the Control in this way :

ASPxPanel obj = (ASPxPanel)Panel_Image_Multimedia.FindControl("Txt_Image_text");

But, I am getting Null for obj.

Is it Possible to access them through UniqueID ?

RealSteel
  • 1,871
  • 3
  • 37
  • 74

0 Answers0