PDA

View Full Version : Simple variable inside a link


pix
05-15-2006, 12:04 PM
I'm unsure of the correct syntax to place a defined variable (a recordset value) within a link e.g.

<% Dim myVar
myVar = "(rs_recordset.Fields.Item('myRecord').Value)"
%>


<a href="page.asp?Selection=myVar">

As you may be able to tell, I'm new to this.
Can anyone help?

degsy
05-15-2006, 04:05 PM
<a href="page.asp?Selection=<%=myVar%>">

pix
05-15-2006, 04:50 PM
Cool thanks! I was so close to guessing... <%myVar%>

degsy
05-15-2006, 04:54 PM
You have to output it. If not using shorttags then use Response.Write