|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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? |
|
#3
|
|||
|
|||
|
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>"
|
|
#4
|
|||
|
|||
|
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? |
|
#5
|
|||
|
|||
|
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>"
|
|
#6
|
|||
|
|||
|
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?
|
|
#7
|
|||
|
|||
|
Not sure I understand what you mean...
|
|
#8
|
|||
|
|||
|
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.
|
|
#9
|
|||
|
|||
|
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
|
|
#10
|
|||
|
|||
|
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? |
|
#11
|
||||
|
||||
|
Response.Write("<a href=mailto:" & RS("Email_Link") & ">" & RS("Email_Link") & "</a>")
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > ASP and Access hyperlink fields |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|