473,888 Members | 1,499 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to hide red cross when no image available?

Ben
Hi,

i defined an imagebutton like this:
<asp:ImageButto n ID="ImageButton 1" runat="server" />

Sometimes, the picture must be shown, sometimes not.
I did this in code-behind:
Dim x As Integer

x = 4

If x = 5 Then

ImageButton1.Im ageUrl = "~/fotos/hei80.jpg"

End If

So now, i get a red cross instead of the picture. What i want is to get rid
of that red cross and to see nothing.

Thanks
Ben
Oct 13 '08 #1
2 2176
Ben
I found it like this:
Dim x As Integer
Dim img As ImageButton
img = New ImageButton
img.ImageUrl = "~/fotos/hei80.jpg"
x = 5
If x = 5 Then
form1.Controls. Add(img)
End If

"Ben" <kn*@shdv.sdsch reef in bericht
news:O1******** ******@TK2MSFTN GP06.phx.gbl...
Hi,

i defined an imagebutton like this:
<asp:ImageButto n ID="ImageButton 1" runat="server" />

Sometimes, the picture must be shown, sometimes not.
I did this in code-behind:
Dim x As Integer

x = 4

If x = 5 Then

ImageButton1.Im ageUrl = "~/fotos/hei80.jpg"

End If

So now, i get a red cross instead of the picture. What i want is to get
rid of that red cross and to see nothing.

Thanks
Ben


Oct 13 '08 #2
"Ben" <kn*@shdv.sdwro te in message
news:O1******** ******@TK2MSFTN GP06.phx.gbl...
So now, I get a red cross instead of the picture. What I want is to get
rid of that red cross and to see nothing.
http://msdn.microsoft.com/en-us/libr...rnatetext.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 13 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4529
by: adrien | last post by:
Thanks for all the answers about how to hide scrollbars in netscape. The conclusion is that it's not possible. My initial purpose is to compare some Netscape and IE possibilities and it's the second time that i have to conclude that Netscape can't do something while IE does: 1) IE is able to hide scrollbars (even only vertical or only horizontal) while Netscape is not. 2) IE is able to start a sound (wav) when the mouse e.g. goes over an...
12
6311
by: deko | last post by:
Is there any way to work around the blank space created by hidden divs? I'm trying to use a relatively postioned divs with show/hide behaviors to annotate an image. The divs show/hide onMouseOver/onMouseOut but leave a blank space on the page when hidden (the space where the divs would normally be). Is it possible to use z-indexing to put regular content where the hidden divs would be? When I try to do this, the layers don't unhide as...
27
4768
by: Nicholas Couch | last post by:
I have a little form with a couple of dynamically generated list boxes. When the user makes a selection from the first box, the second box is refreshed. When they make a selection from the second box, I concatenate the selections from the two boxes and add the string to a list at the top of the form, using createElement and appendChild. The list is actually a bunch of span elements contained within a div. Each span element includes a small...
3
3255
by: BB | last post by:
Hi, I am using repeater control.in my aspx page. one of the column of control displays images. Filenames of images are stored in table. Now when I run it and if display Image is blank. I see place holder and red cross in it in Internet Explorer. But it works fine in FireFox. Is there any way to fix this so that in both browers I can see same ie hide placeholder and red cross? I have tried to use alternatetext property for image control. ...
1
2489
by: saikris | last post by:
I have a requirement in which I need to check some files and provide the report on UI. And I would like to design this in such a way that on Windows form it displays all file names and then it starts checking one after other. If it meets criteria, Green tick image would come after filename, otherwise Red Cross image. I can do file check but how can I display either Green Tick or Red Cross image based on result. Is there any...
6
3221
by: Doogie | last post by:
Hi I have an img control I am trying to hide upon certain types of commands in my code behind. When to hide it is directly tied to a asp:dropdownlist control. So depending on what the user selects in that dropdownlist, this image will be hidden or be displayed. I have tied the onselectedindexchanged value of the dropdownlist to a c-sharp method (not javascript) because other things are being done as well that I want to do server side. ...
0
10800
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information inside an image, hide your complete image as text ,search for a particular image inside a directory, minimize the size of the image. However this is not a new concept, there is a concept called Steganography which enables to conceal your secret...
0
11180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10778
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10439
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9597
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7990
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7148
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5817
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4244
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.