Opening new window with frontpage link (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


WIryeman -> Opening new window with frontpage link (11/2/2003 13:07:47)

I have tried several different ways but I can not get the coding right please help here is my code and it is on spookey's diet

<%="<a href=""" & FP_FieldLink(fp_rs,"URL") & """>" & FP_FieldVal(fp_rs,"URL") & "</a>"%>

Thanks In Advance




Spooky -> RE: Opening new window with frontpage link (11/2/2003 13:50:52)

Doesnt look too bad. Perhaps use FP_Field() instead of FP_FieldLink()

What is the result you are seeing?




WIryeman -> RE: Opening new window with frontpage link (11/2/2003 14:01:49)

The displaying is fine I just can not get it so the link opens in a new window. As it sits because I am using frames the link opens in the same frame. These are outside links so I want the user to have a new window open when they click on it




Patti -> RE: Opening new window with frontpage link (11/2/2003 14:15:56)

I think all you need is to add in the hyperlink target="_blank" to open in new window.

I open some links on my page using asp as follows:

<a href="http://<%=strURL%>" target="_blank"><%=strWebsite%></a>

Patti




WIryeman -> RE: Opening new window with frontpage link (11/2/2003 14:19:07)

I have tried that in the location you suggested and I get an asp coding errror when I open the page with the link on it.




Patti -> RE: Opening new window with frontpage link (11/2/2003 14:30:59)

Can you tell us the asp error you get.

Patti




WIryeman -> RE: Opening new window with frontpage link (11/2/2003 14:37:28)

With this coding:

<%="<a target="_blank" href=""" & FP_FieldLink(fp_rs,"URL") & """>" & FP_FieldVal(fp_rs,"URL") & "</a>"%>


I get this error:

Microsoft VBScript compilation error '800a0408'

Invalid character

/Links/PostedLinks.asp, line 74

Response.Write("<a target="_blank" href=""" & FP_FieldLink(fp_rs,"URL") & """>" & FP_FieldVal(fp_rs,"URL") & "</a>")




Spooky -> RE: Opening new window with frontpage link (11/2/2003 17:21:44)

<%="<a target=""_blank"" href=""" & FP_FieldLink(fp_rs,"URL") & """>" & FP_FieldVal(fp_rs,"URL") & "</a>"%>

Use 2 quotes or a single quote inside the asp string.




Patti -> RE: Opening new window with frontpage link (11/2/2003 17:53:08)

[;)] I knew if I waited long enough spooky would find it.

Patti




WIryeman -> RE: Opening new window with frontpage link (11/2/2003 17:55:50)

Thank you Spooky

Duh! I guess you get a little rusty on the rules when you only tinker with your code every now and then.

Thanks Again




Spooky -> RE: Opening new window with frontpage link (11/2/2003 17:59:35)

No worries - depends what you need them for.
These are all valid syntax:

<%="<a target=_blank href='" & FP_FieldLink(fp_rs,"URL") & "'>" & FP_FieldVal(fp_rs,"URL") & "</a>"%>
<%="<a target='_blank' href='" & FP_FieldLink(fp_rs,"URL") & "'>" & FP_FieldVal(fp_rs,"URL") & "</a>"%>
<%="<a target=""_blank"" href=""" & FP_FieldLink(fp_rs,"URL") & """>" & FP_FieldVal(fp_rs,"URL") & "</a>"%>
<a target=_blank href="<%=FP_FieldLink(fp_rs,"URL")%>"><%=FP_FieldVal(fp_rs,"URL")%></a>




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
6.298828E-02