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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Response.Write passing URL vars

Status
Not open for further replies.

credo

Programmer
Jul 26, 2001
50
0
0
GB
Hello,

I am having trouble with an ASP statement...

I have an if statement that if is true, writes a an image and then a link to go to "book.asp" page. I want to make the link dynamic and pass a variable across when the URL is clicked by the user to the book.asp page (the variable is held in MM_keepURL function).

Code:
<td align="center" valign="middle" bgcolor="#FFFFFF" class="gen2">

<% If (rs_av.Fields.Item("w1_Avail").Value = True) Then
Response.Write "<img src='images/dab2.gif' alt='book this week'> <a href='book.asp?<%=MM_keepURL%>'>Book</a>"
Else
Response.Write " - "
End If
%>
</td>


I've tried moving the single quotes ' and double quotes but am not having any success. How do I write a repsonse.write <%= within a repsonse.write ?

Any tips gratefuly appreciated.
 
Your <%=MM_keepURL%> is in a <% %> block:
Code:
<% 
If (rs_av.Fields.Item("w1_Avail").Value = True) then
 Response.Write "<img src=""images/dab2.gif""> " &_
   "<a href=""book.asp?" & MM_keepURL & """>Book</a>"
else 
 response.Write " - "
end If

%>

hth,
Foxbox
ttmug.gif
 
thanks very much - it now works.. !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top