In the .ascx:
<asp:Image id='Image1' runat='server'></asp:Image>
In .aspx
VB.NET
<uc1:UCImage id='UCImage1' source='b2346.jpg' runat='server'></uc1:UCImage>
Dim UC As UserControl
Dim imgUC As System.Web.UI.WebControls.Image
UC = Page.FindControl('UCImage1')
imgUC = UC.FindControl('Image1')
imgUC.ImageUrl = 'b2346.jpg'
C#
UserControl UC ;
System.Web.UI.WebControls.Image imgUC ;
UC = (UserControl)Page.FindControl('UCImage1');
imgUC =(System.Web.UI.WebControls.Image)UC.FindControl('Image1');
imgUC.ImageUrl = 'b2346.jpg';
Share with