Forums

ASP

This topic is locked

ASP If statement with hyper link and parameter

Posted 23 Jan 2013 11:48:07
1
has voted
23 Jan 2013 11:48:07 Jacqui Brimacombe posted:
I would like some help on if statements.
what i am trying to do is to say
If Statement is true the go to a url with the parameter of ID.
Below works but as i have not put i the parameter i goes to the first record.
<% If(rsCGReg.Fields.Item("RegInvoiceReceived".Value) = False Then Response.write ("<a href=../Admin/AdminSection/StudentDetails/City&Guilds/CGDetails/RegInvoiceRec.asp'>Link</a>"%>

Below is the nearest i can get
if i put in =(rsCGReg.Fields.Item("StudentID".Value)
it throws an error and if =(rsCGReg.Fields.Item('StudentID').Value the link works but again shows the first record.

<% If(rsCGReg.Fields.Item("RegInvoiceReceived".Value) = False Then Response.write ("<a href=../Admin/AdminSection/StudentDetails/City&Guilds/CGDetails/RegInvoiceRec.asp?StudentID=(rsCGReg.Fields.Item('StudentID').Value)'>Link</a>"%>

Hope you can help with this one.
Thank you

Replies

Replied 23 Jan 2013 11:50:32
23 Jan 2013 11:50:32 Jacqui Brimacombe replied:
Not sure why many of the brackets have been replaced with
Replied 11 Feb 2013 11:32:20
11 Feb 2013 11:32:20 Les IsOnline replied:
You may have to put double quotes round the contents Response.write

If linkURL <> "" and linkName <> "" Then
Response.Write("<a href=""http://""" & linkURL & """>" & linkName & "</a><br>")
End If


Reply to this topic