recruitit
asked on
Hiding an ASP.NET Image Control from Javascript
Hello everyone!
Got a really irritating problem that just wont quit.
I am trying to hide an <asp:image> control from javascript.
What I basically have are the following three components
asp:ImageMap
asp:RectangleHotSpot
asp:Image
Now, the asp:Image is an overlay to the ImageMap. It starts with Visible set to false.
When the user clicks the RectangleHotSpot, I want to make the asp:image visible.
I have setup my asp:ImageMap to use HotSpotMode="Navigate".
The asp:RectangleHotSpot has the navigation url set to "javascript:flipImageVisib ility('1') ;"
Each hotspot will have its own value that it imputs into the flipImageVisibility function.
The javascript function is defined below in the code part.
What essentially happens is that document.getElementById always returns null. I have tried using the exact id, as well as the objectid.ClientID. Both always return null.
Anyone know what could possibly be wrong?
Thanks!
Got a really irritating problem that just wont quit.
I am trying to hide an <asp:image> control from javascript.
What I basically have are the following three components
asp:ImageMap
asp:RectangleHotSpot
asp:Image
Now, the asp:Image is an overlay to the ImageMap. It starts with Visible set to false.
When the user clicks the RectangleHotSpot, I want to make the asp:image visible.
I have setup my asp:ImageMap to use HotSpotMode="Navigate".
The asp:RectangleHotSpot has the navigation url set to "javascript:flipImageVisib
Each hotspot will have its own value that it imputs into the flipImageVisibility function.
The javascript function is defined below in the code part.
What essentially happens is that document.getElementById always returns null. I have tried using the exact id, as well as the objectid.ClientID. Both always return null.
Anyone know what could possibly be wrong?
Thanks!
function flipImageVisibility(id) {
switch (id) {
case "1":
document.getElementById('<%=imgOverlay1.ClientID%>').Visible =
! document.getElementById('<%=imgOverlay1.ClientID%>').Visible;
break;
}
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER