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

Discussion in 'ASP General' started by Rob McLennan - ZETLAND, Jan 21, 2004.

  1. 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
    Rob McLennan - ZETLAND, Jan 21, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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
    Aaron Bertrand [MVP], Jan 21, 2004
    #2
    1. Advertising

  3. "Aaron Bertrand [MVP]" <> wrote in message news:<>...
    > 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" <> wrote in message
    > news:...
    > > 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!
    Rob McLennan - ZETLAND, Feb 3, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KathyB
    Replies:
    2
    Views:
    543
    Kathy Burke
    Jul 2, 2003
  2. KK
    Replies:
    2
    Views:
    546
    Big Brian
    Oct 14, 2003
  3. sck10
    Replies:
    2
    Views:
    2,809
    Walter Wang [MSFT]
    Jun 5, 2006
  4. Replies:
    1
    Views:
    829
  5. mohit
    Replies:
    0
    Views:
    545
    mohit
    Jan 23, 2008
Loading...

Share This Page