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

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

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <ro*****@hotmail.com> wrote in message
news:72**************************@posting.google.c om...
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

Jul 19 '05 #2

P: n/a
"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message news:<OJ*************@tk2msftngp13.phx.gbl>...
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" <ro*****@hotmail.com> wrote in message
news:72**************************@posting.google.c om...
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!
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.