Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - html within response.write
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

html within response.write

 Post Reply Post Reply
Author
ainsworth14 View Drop Down
Groupie
Groupie


Joined: 05 August 2003
Location: United Kingdom
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote ainsworth14 Quote  Post ReplyReply Direct Link To This Post Topic: html within response.write
    Posted: 15 August 2004 at 2:39pm

 hi

what i am trying to do is display a link when my audio field in the db is not empty

the entry in my audio field corresponds to the ID field.

to save space in my DB i want only to enter '1650' in to the DB audio field and then for my asp page to display the link:

<a href="audio\1650.mp3">listen</a> on my page, i currently have the following code

<%
  
  If isNull(rsResults("audio")) THEN
  response.write ""
  ELSE
   response.write "<a href=""audio\" & rsResults("audio") & ".mp3""> listen </a>"
   END IF
   %>

but all i get in my url is audio\.mp3

why wont it read the reResults bit? any ideas?

thanks

mark

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 15 August 2004 at 4:54pm

Null is not the same as "". A string or a data base field that has been set to "" actually has an end-of-string character. A data base field set to Null doesn't have it. If you compare the two, they will be different.

Check to see if your db initializes the audio field to "" or null. If the field is defined as numeric, change the IsNull to IsNumeric

Also, try doing a response.write rsresults("audio") just before the If statement


Lead me not into temptation... I know the short cut, follow me.
Back to Top
ainsworth14 View Drop Down
Groupie
Groupie


Joined: 05 August 2003
Location: United Kingdom
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote ainsworth14 Quote  Post ReplyReply Direct Link To This Post Posted: 16 August 2004 at 2:16pm

hi

all working now, thanks a lot, the code i pasted above actually works today?!

i tried the response.write like above then took it off and it worked?!!

many thanks

mark

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 16 August 2004 at 2:35pm

Originally posted by ainsworth14 ainsworth14 wrote:

i tried the response.write like above then took it off and it worked?!!

lol - could have been a cache problem This piece of code helps alleviate cache problems, but nothing works 100%

    pStr = "private, no-cache, must-revalidate" 
    Response.ExpiresAbsolute = #2000-01-01# 
    Response.AddHeader "pragma", "no-cache" 
    Response.AddHeader "cache-control", pStr 


Lead me not into temptation... I know the short cut, follow me.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.