473,471 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to hide red cross when no image available?

Ben
Hi,

i defined an imagebutton like this:
<asp:ImageButton ID="ImageButton1" 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.ImageUrl = "~/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 2165
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.sdschreef in bericht
news:O1**************@TK2MSFTNGP06.phx.gbl...
Hi,

i defined an imagebutton like this:
<asp:ImageButton ID="ImageButton1" 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.ImageUrl = "~/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.sdwrote in message
news:O1**************@TK2MSFTNGP06.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
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...
12
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...
27
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...
3
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...
1
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...
6
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...
0
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
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...
0
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
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.