By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,570 Members | 1,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,570 IT Pros & Developers. It's quick & easy.

hyperlink in asp

P: n/a
Hey gang.

i have this

Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") & vbCrLf

coming from access db.

how can i get that to make a hyperlink clickable as well??

Thanks
May 23 '06 #1
Share this Question
Share on Google+
15 Replies


P: n/a

"Jeff" <gi*****@adelphia.net> wrote in message
news:9u******************************@adelphia.com ...
Hey gang.

i have this

Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") & vbCrLf

coming from access db.

how can i get that to make a hyperlink clickable as well??

Thanks


http://www.w3schools.com/

Run through HTML and ASP sections.
May 23 '06 #2

P: n/a
"Anthony Jones" <An*@yadayadayada.com> wrote in message
news:OP****************@TK2MSFTNGP04.phx.gbl...

"Jeff" <gi*****@adelphia.net> wrote in message
news:9u******************************@adelphia.com ...
Hey gang.

i have this

Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") &
vbCrLf

coming from access db.

how can i get that to make a hyperlink clickable as well??

Thanks


http://www.w3schools.com/

Run through HTML and ASP sections.

I don't mind searching, but I can't find the key words to find what I am
looking for.
Any ideas?
May 23 '06 #3

P: n/a

Jeff wrote:
"Anthony Jones" <An*@yadayadayada.com> wrote in message
news:OP****************@TK2MSFTNGP04.phx.gbl...

"Jeff" <gi*****@adelphia.net> wrote in message
news:9u******************************@adelphia.com ...
Hey gang.

i have this

Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") &
vbCrLf

coming from access db.

how can i get that to make a hyperlink clickable as well??

Thanks


http://www.w3schools.com/

Run through HTML and ASP sections.

I don't mind searching, but I can't find the key words to find what I am
looking for.
Any ideas?


This is pretty basic stuff. How would you make a hyperlink in html?
Then how would you response.write that?

--
Mike Brind

May 23 '06 #4

P: n/a
I understand that, but I don't understand how to make it read a text block,
from a DB, and make it show clickable links, when needed.

Back to the drawing board i guess..lol

"Mike Brind" <pa*******@hotmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...

Jeff wrote:
"Anthony Jones" <An*@yadayadayada.com> wrote in message
news:OP****************@TK2MSFTNGP04.phx.gbl...
>
> "Jeff" <gi*****@adelphia.net> wrote in message
> news:9u******************************@adelphia.com ...
>> Hey gang.
>>
>> i have this
>>
>> Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") &
>> vbCrLf
>>
>> coming from access db.
>>
>> how can i get that to make a hyperlink clickable as well??
>>
>> Thanks
>>
>>
>
> http://www.w3schools.com/
>
> Run through HTML and ASP sections.
>
>

I don't mind searching, but I can't find the key words to find what I am
looking for.
Any ideas?


This is pretty basic stuff. How would you make a hyperlink in html?
Then how would you response.write that?

--
Mike Brind

May 23 '06 #5

P: n/a

http://www.powerasp.com/content/new/...hyperlinks.asp
"Anthony Jones" <An*@yadayadayada.com> wrote in message
news:OP****************@TK2MSFTNGP04.phx.gbl...

"Jeff" <gi*****@adelphia.net> wrote in message
news:9u******************************@adelphia.com ...
Hey gang.

i have this

Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") &
vbCrLf

coming from access db.

how can i get that to make a hyperlink clickable as well??

Thanks


http://www.w3schools.com/

Run through HTML and ASP sections.

May 24 '06 #6

P: n/a
lol

Bob Lehmann

"Jeff" <gi*****@adelphia.net> wrote in message
news:Tp******************************@adelphia.com ...
I understand that, but I don't understand how to make it read a text block, from a DB, and make it show clickable links, when needed.

Back to the drawing board i guess..lol

"Mike Brind" <pa*******@hotmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...

Jeff wrote:
"Anthony Jones" <An*@yadayadayada.com> wrote in message
news:OP****************@TK2MSFTNGP04.phx.gbl...
>
> "Jeff" <gi*****@adelphia.net> wrote in message
> news:9u******************************@adelphia.com ...
>> Hey gang.
>>
>> i have this
>>
>> Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") &
>> vbCrLf
>>
>> coming from access db.
>>
>> how can i get that to make a hyperlink clickable as well??
>>
>> Thanks
>>
>>
>
> http://www.w3schools.com/
>
> Run through HTML and ASP sections.
>
>
I don't mind searching, but I can't find the key words to find what I am looking for.
Any ideas?


This is pretty basic stuff. How would you make a hyperlink in html?
Then how would you response.write that?

--
Mike Brind


May 24 '06 #7

P: n/a
now that i DO understand..lol

thanks a bunch
"Kyle Peterson" <ky*****@hotmail.com> wrote in message
news:OK**************@TK2MSFTNGP04.phx.gbl...

http://www.powerasp.com/content/new/...hyperlinks.asp
"Anthony Jones" <An*@yadayadayada.com> wrote in message
news:OP****************@TK2MSFTNGP04.phx.gbl...

"Jeff" <gi*****@adelphia.net> wrote in message
news:9u******************************@adelphia.com ...
Hey gang.

i have this

Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") &
vbCrLf

coming from access db.

how can i get that to make a hyperlink clickable as well??

Thanks


http://www.w3schools.com/

Run through HTML and ASP sections.


May 24 '06 #8

P: n/a
>From the page in the link:

"People seem to act like this is some sort of mystical and complex
process and they couldn't be farther from the truth. Like I keep
telling everyone ASP is just dynamically created HTML and making a
hyperlink is accomplished by mixing HTML tags with the ASP variables.
It's very simple to make a hyperlink."

Hmmm.... so your discombobulation over hyperlinks appears to be shared
by others. I shall endeavour to be a little more understanding in
future :-)

--
Mike Brind

Jeff wrote:
now that i DO understand..lol

thanks a bunch
"Kyle Peterson" <ky*****@hotmail.com> wrote in message
news:OK**************@TK2MSFTNGP04.phx.gbl...

http://www.powerasp.com/content/new/...hyperlinks.asp
"Anthony Jones" <An*@yadayadayada.com> wrote in message
news:OP****************@TK2MSFTNGP04.phx.gbl...

"Jeff" <gi*****@adelphia.net> wrote in message
news:9u******************************@adelphia.com ...
Hey gang.

i have this

Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") &
vbCrLf

coming from access db.

how can i get that to make a hyperlink clickable as well??

Thanks

http://www.w3schools.com/

Run through HTML and ASP sections.



May 24 '06 #9

P: n/a
I give up. Seems like this one is too easy, yet it keeps eluding me.

"Jeff" <gi*****@adelphia.net> wrote in message
news:9u******************************@adelphia.com ...
Hey gang.

i have this

Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") & vbCrLf

coming from access db.

how can i get that to make a hyperlink clickable as well??

Thanks

May 26 '06 #10

P: n/a
Jeff wrote on 26 mei 2006 in microsoft.public.inetserver.asp.general:
"Jeff" <gi*****@adelphia.net> wrote in message

Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") &
vbCrLf

coming from access db.

how can i get that to make a hyperlink clickable as well??

[please do not toppost on usenet]
I give up. Seems like this one is too easy, yet it keeps eluding me.


You cannot get that to make a hyperlink clickable,
as a hyperlink is clickable by itself.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 26 '06 #11

P: n/a
Jeff wrote:
I give up. Seems like this one is too easy, yet it keeps eluding me.

"Jeff" <gi*****@adelphia.net> wrote in message
news:9u******************************@adelphia.com ...
Hey gang.

i have this

Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") &
vbCrLf coming from access db.

how can i get that to make a hyperlink clickable as well??

Thanks


Why don't you tell us
1. What is in Rs("Event_Details") ?
2. What you want to see in the source sent to the browser? (what one would
see when selecting View Source)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 26 '06 #12

P: n/a
Ok. I went about this a different way. I had an old script that changed
spaces, <br>'s and stuff... so i went with that, then used a little html,
and the result is this, and it works.
<br>
<font face="Verdana,Arial" size="1"><% myString =
Replace(Rs("Event_Details"), vbCrLf, " <br> ")%><%=
InsertHyperlinks(myString)%><br>
&nbsp;</font></p>
thanks again.
Bob, thanks for replying, and what it was showing in the source, was the
link without it being clickable. but with this code it is.

Thanks again.
"Jeff" <gi*****@adelphia.net> wrote in message
news:bs******************************@adelphia.com ...
I give up. Seems like this one is too easy, yet it keeps eluding me.

"Jeff" <gi*****@adelphia.net> wrote in message
news:9u******************************@adelphia.com ...
Hey gang.

i have this

Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") &
vbCrLf

coming from access db.

how can i get that to make a hyperlink clickable as well??

Thanks


May 27 '06 #13

P: n/a
Or, you could have used the obvious:

<a href="[url]"><%=mystring%></a>

There is no such thing as a link that isn't clickable, as Evertjan has
already pointed out. There is a string written to a page, or there is
a string encapsulated in an <a href> tag which forms a hyperlink. As I
said - basic html.

--
Mike Brind
Jeff wrote:
Ok. I went about this a different way. I had an old script that changed
spaces, <br>'s and stuff... so i went with that, then used a little html,
and the result is this, and it works.
<br>
<font face="Verdana,Arial" size="1"><% myString =
Replace(Rs("Event_Details"), vbCrLf, " <br> ")%><%=
InsertHyperlinks(myString)%><br>
&nbsp;</font></p>
thanks again.
Bob, thanks for replying, and what it was showing in the source, was the
link without it being clickable. but with this code it is.

Thanks again.
"Jeff" <gi*****@adelphia.net> wrote in message
news:bs******************************@adelphia.com ...
I give up. Seems like this one is too easy, yet it keeps eluding me.

"Jeff" <gi*****@adelphia.net> wrote in message
news:9u******************************@adelphia.com ...
Hey gang.

i have this

Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") &
vbCrLf

coming from access db.

how can i get that to make a hyperlink clickable as well??

Thanks



May 27 '06 #14

P: n/a
Oh, wait a minute... let me guess...

Event Details is a memo field that contains some text describing an
event, and also includes email and/or web addresses, and it is these
that you want to identify and turn into hyperlinks. Is that right?
You don't want to turn the whole field into a hyperlink, do you?

If this is the case, and you had explained your problem properly at the
beginning, I would have posted this code several days ago:

<%
function create_links(strText)
strText = " " & strText
strText = ereg_replace(strText, "(^|[\n ])([\w]+?://[^ ,""\s<]*)",
"$1<a href=""$2"" target=""_blank"">$2</a>")
strText = ereg_replace(strText, "(^|[\n ])((www|ftp)\.[^ ,""\s<]*)",
"$1<a href=""http://$2"" target=""_blank"">$2</a>")
strText = ereg_replace(strText, "(^|[\n
])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)", "$1<a
href=""mailto:$2@$3"">$2@$3</a>")
strText = right(strText, len(strText)-1)
create_links = strText
end function

function ereg_replace(strOriginalString, strPattern, strReplacement)
' Function replaces pattern with replacement
dim objRegExp : set objRegExp = new RegExp
objRegExp.Pattern = strPattern
objRegExp.IgnoreCase = True
objRegExp.Global = True
ereg_replace = objRegExp.replace(strOriginalString, strReplacement)
set objRegExp = nothing
end function
%>

which you call like this:
<%
Response.Write create_links(myString)
%>

In fact, I tend to use it on data prior to inserting it into a
database, which means the function isn't called every time a user
requests a page which contains text that might or might not have email
or web addresses in it that need to be turned into links. Does your
InsertLinks() function do the same thing?

--
Mike Brind
Mike Brind wrote:
Or, you could have used the obvious:

<a href="[url]"><%=mystring%></a>

There is no such thing as a link that isn't clickable, as Evertjan has
already pointed out. There is a string written to a page, or there is
a string encapsulated in an <a href> tag which forms a hyperlink. As I
said - basic html.

--
Mike Brind
Jeff wrote:
Ok. I went about this a different way. I had an old script that changed
spaces, <br>'s and stuff... so i went with that, then used a little html,
and the result is this, and it works.
<br>
<font face="Verdana,Arial" size="1"><% myString =
Replace(Rs("Event_Details"), vbCrLf, " <br> ")%><%=
InsertHyperlinks(myString)%><br>
&nbsp;</font></p>
thanks again.
Bob, thanks for replying, and what it was showing in the source, was the
link without it being clickable. but with this code it is.

Thanks again.
"Jeff" <gi*****@adelphia.net> wrote in message
news:bs******************************@adelphia.com ...
I give up. Seems like this one is too easy, yet it keeps eluding me.

"Jeff" <gi*****@adelphia.net> wrote in message
news:9u******************************@adelphia.com ...
> Hey gang.
>
> i have this
>
> Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") &
> vbCrLf
>
> coming from access db.
>
> how can i get that to make a hyperlink clickable as well??
>
> Thanks
>


May 27 '06 #15

P: n/a
right... this is what i have at the top of the page
<%

Function InsertHyperlinks(inText)
Dim objRegExp, strBuf
Dim objMatches, objMatch
Dim Value, ReplaceValue, iStart, iEnd

strBuf = ""
iStart = 1
iEnd = 1
Set objRegExp = New RegExp

objRegExp.Pattern = "\b(www|http|\S+@)\S+\b" ' Match URLs and emails
objRegExp.IgnoreCase = True ' Set case insensitivity.
objRegExp.Global = True ' Set global applicability.
Set objMatches = objRegExp.Execute(inText)
For Each objMatch in objMatches
iEnd = objMatch.FirstIndex
strBuf = strBuf & Mid(inText, iStart, iEnd-iStart+1)
If InStr(1, objMatch.Value, "@") Then
strBuf = strBuf & GetHref(objMatch.Value, "EMAIL", "_BLANK")
Else
strBuf = strBuf & GetHref(objMatch.Value, "WEB", "_BLANK")
End If
iStart = iEnd+objMatch.Length+1
Next
strBuf = strBuf & Mid(inText, iStart)
InsertHyperlinks = strBuf
End Function
Function GetHref(url, urlType, Target)
Dim strBuf

strBuf = "<a href="""
If UCase(urlType) = "WEB" Then
If LCase(Left(url, 3)) = "www" Then
strBuf = "<a href=""http://" & url & """ Target=""" & _
Target & """>" & url & "</a>"
Else
strBuf = "<a href=""" & url & """ Target=""" & _
Target & """>" & url & "</a>"
End If
ElseIf UCase(urlType) = "EMAIL" Then
strBuf = "<a href=""mailto:" & url & """ Target=""" & _
Target & """>" & url & "</a>"
End If

GetHref = strBuf

End Function
%>

and the
<% myString = Replace((event_details), vbCrLf, " <br> ")%><%=
InsertHyperlinks(myString)%>

is the output for the field

if all that was in there was the url, i could have done that with no
problem. the problem was converting what i posted originally into a
response.write so i avoided that, and made it into html with some script.
thanks for all the help :)
"Mike Brind" <pa*******@hotmail.com> wrote in message
news:11*********************@i40g2000cwc.googlegro ups.com...
Oh, wait a minute... let me guess...

Event Details is a memo field that contains some text describing an
event, and also includes email and/or web addresses, and it is these
that you want to identify and turn into hyperlinks. Is that right?
You don't want to turn the whole field into a hyperlink, do you?

If this is the case, and you had explained your problem properly at the
beginning, I would have posted this code several days ago:

<%
function create_links(strText)
strText = " " & strText
strText = ereg_replace(strText, "(^|[\n ])([\w]+?://[^ ,""\s<]*)",
"$1<a href=""$2"" target=""_blank"">$2</a>")
strText = ereg_replace(strText, "(^|[\n ])((www|ftp)\.[^ ,""\s<]*)",
"$1<a href=""http://$2"" target=""_blank"">$2</a>")
strText = ereg_replace(strText, "(^|[\n
])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)", "$1<a
href=""mailto:$2@$3"">$2@$3</a>")
strText = right(strText, len(strText)-1)
create_links = strText
end function

function ereg_replace(strOriginalString, strPattern, strReplacement)
' Function replaces pattern with replacement
dim objRegExp : set objRegExp = new RegExp
objRegExp.Pattern = strPattern
objRegExp.IgnoreCase = True
objRegExp.Global = True
ereg_replace = objRegExp.replace(strOriginalString, strReplacement)
set objRegExp = nothing
end function
%>

which you call like this:
<%
Response.Write create_links(myString)
%>

In fact, I tend to use it on data prior to inserting it into a
database, which means the function isn't called every time a user
requests a page which contains text that might or might not have email
or web addresses in it that need to be turned into links. Does your
InsertLinks() function do the same thing?

--
Mike Brind
Mike Brind wrote:
Or, you could have used the obvious:

<a href="[url]"><%=mystring%></a>

There is no such thing as a link that isn't clickable, as Evertjan has
already pointed out. There is a string written to a page, or there is
a string encapsulated in an <a href> tag which forms a hyperlink. As I
said - basic html.

--
Mike Brind
Jeff wrote:
> Ok. I went about this a different way. I had an old script that changed
> spaces, <br>'s and stuff... so i went with that, then used a little
> html,
> and the result is this, and it works.
> <br>
> <font face="Verdana,Arial" size="1"><% myString =
> Replace(Rs("Event_Details"), vbCrLf, " <br> ")%><%=
> InsertHyperlinks(myString)%><br>
> &nbsp;</font></p>
>
>
> thanks again.
> Bob, thanks for replying, and what it was showing in the source, was
> the
> link without it being clickable. but with this code it is.
>
> Thanks again.
> "Jeff" <gi*****@adelphia.net> wrote in message
> news:bs******************************@adelphia.com ...
> >I give up. Seems like this one is too easy, yet it keeps eluding me.
> >
> >
> >
> > "Jeff" <gi*****@adelphia.net> wrote in message
> > news:9u******************************@adelphia.com ...
> >> Hey gang.
> >>
> >> i have this
> >>
> >> Response.Write Replace(Rs("Event_Details") & " ", vbCrLf, "<BR>") &
> >> vbCrLf
> >>
> >> coming from access db.
> >>
> >> how can i get that to make a hyperlink clickable as well??
> >>
> >> Thanks
> >>
> >
> >

May 27 '06 #16

This discussion thread is closed

Replies have been disabled for this discussion.