ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 1st, 2003, 09:54 PM
LilyVorTek LilyVorTek is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Baltimore MD
Posts: 5 LilyVorTek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ASP and Access hyperlink fields

This is crazy... I know there has to be a way to do this but I just can't figure it out.

I have an asp calendar. Nothing complicated really. People enter the data through a form... it writes to a database... and when you click a day it retrieves from the database. The problem is one of the fields is a hyperlink to more information about the event on another website. The text of the link shows but it doesn't actually link.

I have the field in the database set up as hyperlink and not text and I'm pretty sure that the asp code I should be using starts out Response.Write.... I just don't know what to do next... I've tried everything imaginable... below is what I thought it should be but this didn't work

Response.Write "<a href="Rs("Web_Link")">"

I'm sure I'm missing something painfully obvious but I'm fairly new at this so please help

Reply With Quote
  #2  
Old July 2nd, 2003, 02:36 AM
mohecan mohecan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Melbourne, Australia
Posts: 212 mohecan User rank is Private First Class (20 - 50 Reputation Level)mohecan User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
try
Code:
Response.write "<a href=" & Rs("Web_Link") & ">"


The way you have it indicates to the server that the string terminates at the end of the href= string.
__________________
How can I soar like an eagle when
I'm flying with turkey's?

Reply With Quote
  #3  
Old July 2nd, 2003, 03:44 AM
Shad Shad is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 24 Shad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unless your field type 'Hyperlink' puts " " around the text, then you'd need the above but modified like this:

Code:
Response.Write "<a href=""" & Rs("Web_Link")  & """>link</a>"
Why aren't you using a varchar field type, out of interest?

Reply With Quote
  #4  
Old July 2nd, 2003, 09:20 AM
LilyVorTek LilyVorTek is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Baltimore MD
Posts: 5 LilyVorTek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking

Shad,

Thank you! Thank you! Thank you!

That worked once I changed the field type to text. I'm fairly new at this and for some reason, call me crazy, it seemed logical to me that if there is a field type for a hyperlink that the hyperlink information would be transfered as well just by putting in the Response.Write Rs(XXX) of course I found out differently.

What do I do if I want the link to be Mailto:something@something.com instead of a web address?

Reply With Quote
  #5  
Old July 2nd, 2003, 12:39 PM
Shad Shad is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 24 Shad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You could test for the '@' character in the field:

Code:
myfield = RS("Web_Link")
If instr(myfield,"@") > 0 then
    thelink = "mailto:" & myfield
Else
    thelink = myfield
End if

Response.Write "<a href=""" & thelink & """>link</a>"

Reply With Quote
  #6  
Old July 2nd, 2003, 01:26 PM
LilyVorTek LilyVorTek is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Baltimore MD
Posts: 5 LilyVorTek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
what if all the entries in the fields were e-mail addresses and the name of the fields were Email_Link and not Web_Link is there a way to just stick the mailto: comand in there somewhere?

Reply With Quote
  #7  
Old July 2nd, 2003, 01:29 PM
Shad Shad is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 24 Shad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Not sure I understand what you mean...

Reply With Quote
  #8  
Old July 2nd, 2003, 01:31 PM
LilyVorTek LilyVorTek is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Baltimore MD
Posts: 5 LilyVorTek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I don't need it to know the difference between a web link and an e-mail link. I just need to know how to set up both. There would be two form fields. One for web links and one for e-mail links.

Reply With Quote
  #9  
Old July 2nd, 2003, 01:36 PM
Shad Shad is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 24 Shad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Code:
fldEmail = RS("Email_Link")
fldURL = RS("web_Link")

If (fldEmail <> "" or (fldEmail = "" and fldURL <> "")) then
    If fldEmail <> "" then
        thelink = "mailto:" & fldEmail
    Else
        thelink = fldURL
    End if
    Response.Write("<a href=""" & thelink & """>link</a>")
End if
Dead simple to be honest.

Reply With Quote
  #10  
Old July 2nd, 2003, 02:15 PM
LilyVorTek LilyVorTek is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Baltimore MD
Posts: 5 LilyVorTek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
That's still a lot more activity than I need.

I have a form. People fill it out and another page displays everything they fill out. One of those things is an E-mail address. Now that I know how to make the web address an actual link how do I make the e-mail address and actual link and not just text?

Reply With Quote
  #11  
Old July 22nd, 2003, 04:47 AM
spc197's Avatar
spc197 spc197 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: North East of England
Posts: 23 spc197 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 m 28 sec
Reputation Power: 0
Response.Write("<a href=mailto:" & RS("Email_Link") & ">" & RS("Email_Link") & "</a>")

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > ASP and Access hyperlink fields


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway