 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

September 2nd, 2004, 08:20 AM
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Empty record field, No image
This is a ASP.NET VB guestion.
In making a file upload optional, when someone decides not to upload a file, is there a way to make the display page appear without that broken gif image? Maybe with words that say, "image not provided" - something like that....
I am using Dreamweaver MX 2004, ASP.NET VB, Windows 2003 server, MsSQL database.
This is what I've come up with but it doesn't work, I've looked everwhere Experts Exchange, DMZ Zone, etc. and no one can help.
<if isEmpty(dsProperty("Image_01)Response.Write "No Image" Else Response.Write "<img src="../property/<%# dsProperty.FieldValue("Image_01", Container) %>">
|
|

September 2nd, 2004, 09:34 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
You can create a image that reads 'no image' and send use it if the upload is blank. That way there will alwasy be an image file.
|
|

September 2nd, 2004, 09:51 AM
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by stu9820
You can create a image that reads 'no image' and send use it if the upload is blank. That way there will alwasy be an image file.
|
I have tried that, but it will not display either the uploaded image or the no image gif, and to be safe I also tried it with <If isNulls(dsProperty("Image_01"))
Now the field is nchar, but I don't think that should have any effect on this.
Code from the page:
<If isEmpty(dsProperty(Image_01)) Response.Write "<img src="http://www.wdthost.com/property/00image.gif" Else Response.Write"<img src="http://www.wdthost.com/property/<%# dsProperty.FieldValue("Image_01", Container) %>">
|
|

September 2nd, 2004, 10:06 AM
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by dstubblefield
Quote:
|
quote:Originally posted by stu9820
|
Quote:
You can create a image that reads 'no image' and send use it if the upload is blank. That way there will alwasy be an image file.
|
I have tried that, but it will not display either the uploaded image or the no image gif, and to be safe I also tried it with <If isNulls(dsProperty("Image_01"))
Now the field is nchar, but I don't think that should have any effect on this.
Code from the page:
<If isEmpty(dsProperty(Image_01)) Response.Write "<img src="http://www.wdthost.com/property/00image.gif" Else Response.Write"<img src="http://www.wdthost.com/property/<%# dsProperty.FieldValue("Image_01", Container) %>">
Sorry Code should be:
<If isEmpty(dsProperty(Image_01))Response.Write "<img src="http://www.wdthost.com/property/00image.gif%>" Else Response.Write"<img src="http://www.wdthost.com/property/<%# dsProperty.FieldValue("Image_01", Container) %>">
|
|
|

September 2nd, 2004, 12:56 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Code blocks need the be between <% and %> and Response.Write should have parenthesis like this:
Response.Write("Test message...")
|
|

September 2nd, 2004, 06:37 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
As stu9820 said it must be in <% %> tags, and I don't think you have to have the parenthesis, and also, to include quotes " in script, you need to double up like this:
Response.Write ("And I say, ""Hello World!""")
HTH,
Snib
<><
|
|

September 3rd, 2004, 01:05 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
AFAIK, for ASP.NET the parentheses are required.
But dstubblefield, isn't it much easier to use databinding in your code behind? Use an ASP:Image control and then bind the image to your data....
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|
 |