FindControl does not search throughout a hierarchy of controls, I presume that this is a problem.
try using the following method :
public static T FindControlRecursive<T>(Control holder, string controlID) where T : Control
{
Control foundControl = null;
foreach (Control ctrl in holder.Controls)
{
if (ctrl.GetType().Equals(typeof(T)) &&
(string.IsNullOrEmpty(controlID) || (!string.IsNullOrEmpty(controlID) && ctrl.ID.Equals(controlID))))
{
foundControl = ctrl;
}
else if (ctrl.Controls.Count > 0)
{
foundControl = FindControlRecursive<T>(ctrl, controlID);
}
if (foundControl != null)
break;
}
return (T)foundControl;
}
Usage:
Image Showimage = FindControlRecursive<Image>(parent, image.imageName);
In your case parent is this, example :
Image Showimage = FindControlRecursive<Image>(this, image.imageName);
You can use it without ID, then will find first occurrence of T :
Image Showimage = FindControlRecursive<Image>(this, string.Empty);