Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

blank target help...

Status
Not open for further replies.

burnside

Technical User
Dec 4, 2004
236
GB
hi,
have put a java 'no records alert' in this script.
what i cant work out is where to put
target="_blank"
so that if the page is opened it goes to a new page.
i did have it at the end but then the alert was opening
in a blank page.
i only want a blank page if there are records.
i think its got to go before the ELSE...

Code:
<td class=dfasp><div align="center"><a href="<% If (countcurdealnew) > 0 Then Response.Write "dealgrouprep1.asp?lockey=" & Server.URLEncode(lockey) & "&barid=" & Server.URLEncode(barid) & "&nuid=" & Server.URLEncode(1) & "&cfdid="& Server.URLEncode(1) Else Response.Write "javascript:alert('*No Deals to View*');" End If %>"><%=countcurdealnew%></a></div></td>
 
Replace your link with the following

Code:
<a href="<% If (countcurdealnew) > 0 Then Response.Write "dealgrouprep1.asp?lockey=" & Server.URLEncode(lockey) & "&barid=" & Server.URLEncode(barid) & "&nuid=" & Server.URLEncode(1) & "&cfdid="& Server.URLEncode(1) & """ target='_blank'" Else Response.Write "javascript:alert('*No Deals to View*');""" End If %>><%=countcurdealnew%></a>
 
thanks creto

for ne1 whos interested
needs an xtra quote jus after endif

(View*');""" End If %>[red]"[/red]>

 
Actually, it doesn't. Whatever program you use to write your code in is *thinking* it needs another because the closing double quote is written in the vbscript as """

If you view the source with countcurdealnew = 1 or = 0, you'll see that there are the correct number of double quotes.

Now, if you want your source editor to display it pretty, then just change up how the quotes are being done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top