Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Replace Null with default gif

Posted on 2004-08-15
4
Medium Priority
?
251 Views
Last Modified: 2012-06-21
I have been trying to replace the Null field with a default image gif, to get rid of the little x, when there is no image to display, using Dreamweaver MX 2004, ASP.NET VB and MsSQL.

I have tried to use <img src=”<If IsNull(dsProperty("Image_01")) then response.Write("http://wdthost.com/property/no_image.gif") else Response.Write "http://wdthost.com/property/<%# dsProperty.FieldValue("Image_01", Container) %>"> and a few others with out any success.
0
Comment
Question by:ajstubblefield
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 9

Expert Comment

by:prifre
ID: 11805794
Hi,

I would use the FileSystemsObject and the FileExists function.

There are many description on the web on how to use "FileExists"
http://www.codeave.com/asp/code.asp?u_log=60
or
http://www.w3schools.com/asp/showfile.asp?filename=demo_fileexists

with a smile
/prifre
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 11807173
You Should Do this within your SQL Statement.

Select isNull(IMG, 'image_path.gif') As IMG From Table_Name

IMG is the Colum Name in your Table.

Now when you print values on page it will replace automatically
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 11807177
Also make sure dsProperty("Image_01"))  actualy Stored NULL values in DB, not Blank or Empty.

To play around test it with...

if isEmpty(dsProperty("Image_01"))  


OR

if dsProperty("Image_01") = ""
0
 
LVL 9

Accepted Solution

by:
prifre earned 1000 total points
ID: 11876726
From the user...

"Hi, what I have is a real estate site, on the search page there are thumbnails that will take the user to a detail page that has up to 10 thumbnail on it. About 20% of the property listings have no Image or just a few. On the pages, if there is no image uploaded for that property I need to have a default gif or no_image.gif that will replace the little x that shows up or text that says no image provided.

Now I know that in Asp VB you can use this to replace and add text:

<% if myRecordset.Fields.Item("ImageFileName").Value <> "" then %>
<IMG SRC="/upload/<%=myRecordset.Fields.Item("ImageFileName").Value%>">
<% else ' no image %>
Image Not Provided
<% end if ' image check %>

But I can’t find any thing in ASP.NET VB to do the same.

Thanks"

Did not

if isEmpty(dsProperty("Image_01"))

as adilkhan suggested help?

with a smile
/prifre
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question