Morning,
ive added a web image button a web user control, and selected the appropriate image for it, which i can see in design mode, but when i run the project, the button image is just showing the "missing image" red cross. Have i missed something obvious?
regards
Ben
Hi Ben,
I think that is a problem with location of your image. You may try to test accessibility of that image by something like
<img src="imageUsedForButton" />
I would recommend you to create a local-to-project directory like "images" and copy there your image(s).
<img src="./images/myImage.gif" />
Viktor,
I am having the exact same problem. I have a user control that has a Web Image Button on it. That user control is in a folder called Controls. I have another folder in my project root folder called Images which is where I keep all my images; i.e.
Project Root
Now I've tried specifying the image on the button a number of ways, and when looking at the user control in the designer, the image shows up perfect. But when I use the control (i.e. pull it onto another page) in my aspx web page - and when I run it - the image never shows up but instead shows the red x. The only way I have been able to get the image to show up all the time is to hard code the complete path, like C:\Projects\MyProject\Images\mybuttonimage.gif - which of course I can't do in production because it will be on a different server.
BTW, there is no img src tag for the web image button, only the appearance-image URL tag, like so:
<Appearance> <Image url="../Images/mybuttonimage.gif" /> </Appearance>
I've tried ~/Images/mybuttonimage.gif and other varieties and again I can get it to show in the user control designer itself, but when I use the user control itself the image never shows up.
Any ideas? This is bugging me to death. Thanks.
/Tom