Using target="top" in a response.write Please help.

  • Thread starter Rob McLennan - ZETLAND
  • Start date
R

Rob McLennan - ZETLAND

Hi, I'm relatively clueless when it comes to correct ASP syntax. I'm
testing out a search form for my company's website which is done in
ASP. The results are displayed as per the code shown at the very
bottom of this message.

All I want to do is add a target="top" to the URL which is displayed
as a link at the top of the results. I know enough about html to know
that it probably goes somewhere into the follwing section:

<a href=""" & urls(ipage) & """>" & titles(ipage) & "</a>

....but have tried various placements without any luck.

Please help! Thanx.

Full code shown below...



' Display the results
do while (arrayline < matches AND arrayline < result_limit)
ipage = output(0, arrayline)
score = output(1, arrayline)
if (OutputStyle = 0) then
'Basic style
Response.Write("<p>" & "Page: <a href=""" & urls(ipage) &
""">" & titles(ipage) & "</a><br>") & VbCrlf
Response.Write("Score: " & score &
"&nbsp;&nbsp;<small><i>URL:" & urls(ipage) & "</i></small></p>") &
VbCrlf
else
'Descriptive style
Response.Write("<p><b>" & (arrayline+1) & ".</b>&nbsp;<a
href=""" & urls(ipage) & """>" & titles(ipage) & "</a>") & VbCrlf
if (UseCats = True) then
catindex = catpages(ipage)
Response.Write(" <font color=#999999>[" &
catnames(catindex) & "]</font>")
end if
Response.Write("<br>") & VbCrlf

if (Highlighting = 1) then
PrintHighlightDescription(descriptions(ipage))
else
Response.Write(descriptions(ipage))
end if
Response.Write("...<br>") & VbCrlf
Response.Write("<font color=#999999><small><i>Terms matched: "
& output(2, arrayline) & " Score: " & score & "&nbsp;&nbsp;URL: " &
urls(ipage) & "</i></small></font></p>") & VbCrlf
end if
arrayline = arrayline + 1
loop
 
A

Aaron Bertrand [MVP]

Response.Write "<a href='" & urls(ipage) & "' target=_top>" & titles(ipage)
& "</a>"

If you want target=_top to be a part of urls(ipage) then just drop the
quotes around the URL.

urls(0) = "http://www.aspfaq.com/ target=_top"
Response.Write "<a href=" & urls(0) & ">test</a>"

Also see
http://www.aspfaq.com/2052
 
R

Rob McLennan - ZETLAND

Aaron Bertrand said:
Response.Write "<a href='" & urls(ipage) & "' target=_top>" & titles(ipage)
& "</a>"

If you want target=_top to be a part of urls(ipage) then just drop the
quotes around the URL.

urls(0) = "http://www.aspfaq.com/ target=_top"
Response.Write "<a href=" & urls(0) & ">test</a>"

Also see
http://www.aspfaq.com/2052

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/




Rob McLennan - ZETLAND said:
Hi, I'm relatively clueless when it comes to correct ASP syntax. I'm
testing out a search form for my company's website which is done in
ASP. The results are displayed as per the code shown at the very
bottom of this message.

All I want to do is add a target="top" to the URL which is displayed
as a link at the top of the results. I know enough about html to know
that it probably goes somewhere into the follwing section:

<a href=""" & urls(ipage) & """>" & titles(ipage) & "</a>

...but have tried various placements without any luck.

Please help! Thanx.

Full code shown below...



' Display the results
do while (arrayline < matches AND arrayline < result_limit)
ipage = output(0, arrayline)
score = output(1, arrayline)
if (OutputStyle = 0) then
'Basic style
Response.Write("<p>" & "Page: <a href=""" & urls(ipage) &
""">" & titles(ipage) & "</a><br>") & VbCrlf
Response.Write("Score: " & score &
"&nbsp;&nbsp;<small><i>URL:" & urls(ipage) & "</i></small></p>") &
VbCrlf
else
'Descriptive style
Response.Write("<p><b>" & (arrayline+1) & ".</b>&nbsp;<a
href=""" & urls(ipage) & """>" & titles(ipage) & "</a>") & VbCrlf
if (UseCats = True) then
catindex = catpages(ipage)
Response.Write(" <font color=#999999>[" &
catnames(catindex) & "]</font>")
end if
Response.Write("<br>") & VbCrlf

if (Highlighting = 1) then
PrintHighlightDescription(descriptions(ipage))
else
Response.Write(descriptions(ipage))
end if
Response.Write("...<br>") & VbCrlf
Response.Write("<font color=#999999><small><i>Terms matched: "
& output(2, arrayline) & " Score: " & score & "&nbsp;&nbsp;URL: " &
urls(ipage) & "</i></small></font></p>") & VbCrlf
end if
arrayline = arrayline + 1
loop

THANKS AARON!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top