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

Home Posts Topics Members FAQ

Imagefield Nulldisplaytext problem

Good morning all,

I have a product database in which I store some images. I have created
a showThumbnail.aspx page to display the thumbnail image. This page has
no code on it, just the Page directive. The code behind,
showThumbnail.aspx.vb, has this in the Page_Load:
Dim productID As Integer =
Convert.ToInt32(Request.QueryString("ProductID"))

Dim dset As New GroovyGourmet.ProductSmallImageDataTable
ImageAdapter.FillActiveProductSmallImageDataByProd uctID(dset,
productID)

If Not dset.Rows.Count = 0 Then
Response.ContentType = dset.Rows(0)("sm_img_contenttype")
Response.BinaryWrite(dset.Rows(0)("sm_img_data"))
End If

The page with the gridview has the following as the imagefield
attributes:

<asp:ImageField
HeaderText="Photo"
DataImageUrlField="ProductID"
DataImageUrlFormatString="showThumbnail.aspx?Produ ctID={0}"
DataAlternateTextFormatString="Photo of {0}"
NullDisplayText="Picture unavailable" />

When there is no image for a product, the gridview is showing the red
'x' instead of my nulldisplaytext value.

What am I missing? Do I need an 'else' clause in the
showThumbnail.aspx.vb? Right now, if there is no text, the
response.contentType defaults to 'text/html'. Do I need to force it to
'image/pjpeg'? if so, what do I pass to BinaryWrite?

Thanks for any assistance,
Kathryn

Jan 20 '07 #1
0 1183

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

Similar topics

11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
117
by: Peter Olcott | last post by:
www.halting-problem.com
18
by: Ian Stanley | last post by:
Hi, Continuing my strcat segmentation fault posting- I have a problem which occurs when appending two sting literals using strcat. I have tried to fix it by writing my own function that does the...
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
0
by: Benjamin | last post by:
Hi all, I am trying to manage two things on ASP .NET 2.0 with Venus, and I really don’t know how to do it In the gridview you have a ImageField column (with a resized image) which reacts...
3
by: JpMaxMan | last post by:
Greetings - I have found very little definitive information on this. From what I can surmize at some point the ability to update an image in the gridview using the imagefield was removed from the...
1
by: The Colonel | last post by:
I'm using an ImageField in a GridView with the DataImageUrlField set to a URL on the 'Net. The images are not displaying (the URL is correct - I can copy and paste in the browser, they come right...
2
by: Raiders8180 | last post by:
Hi, I'm new to the community (1st post) so I hope I didn't leave anything out. I have a gridview (grdPics) created with 1 Imagefiled (picname) which contains the URL to where the image is stored. ...
0
by: vinothrao84 | last post by:
Hi, i have the below gridview code in my asp.net c# page. Problem is i having an error saying that "A field or property with the name 'ProfileID, Image' was not found on the selected data...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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: 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...
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 ...

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.