实际上,我在我的页面上添加了UserControl
一个面板。现在,我需要在Find the Control 中显示一些文本。TextBox
ComboBox
TextBox
我的用户控件:
<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>
我正在通过以下方式添加控件:
private void LoadImageControls()
{
for (int i = 0; i < int.Parse(ViewState[VIEWSTATEKEY].ToString()); i++)
{
Panel_Image_Multimedia.Controls.Add(LoadControl("~/DynamicControls.ascx"));
}
}
我试图以这种方式找到控件:
ASPxPanel obj = (ASPxPanel)Panel_Image_Multimedia.FindControl("Txt_Image_text");
但是,我正在Null
为obj
.
是否可以通过 访问它们UniqueID
?