If you try to hide the Image as
Image1.Visible = true;
in the server, the Image element will be completely removed from the
DOM[
^]. and you wont be able to control the visibility in javascript( client side).
try this, in c# to hide the element
Image1.Style.Add("display","none");
now the visibility functionality will work as mentioned in the Solution 1
Note:
display:none
removes the element from the place, allowing other elements to fill in that place where as
visibility:hidden
leaves the element in the declared place of the page such that it will still occupies the space