...

View Full Version : nested <% %> tags?



Marcus Dunkus
09-22-2005, 11:27 AM
is it OK to nest asp tags?
I'm doing this(below) but it doesn't like it:

<% if sold= "yes" then
Response.write"<td width='100' height='70' bgcolor=#<%=cellCol%>><img src='car/car_thumbnails/<%thumbnail%>' name='Image1' width='100' height='70' border='0' id='Image1'></a></td>"

end if
%>

If I can't nest the tags how do I include the variable <%=cellcol%> ?

thanks
M

NinjaTurtle
09-22-2005, 11:52 AM
u can't.
u should use the following :
<% if sold= "yes" then
Response.write"<td width='100' height='70' bgcolor=#" & cellCol & ">>..."

end if
%>

NancyJ
09-22-2005, 11:55 AM
you can also do:

<% if sold= "yes" then %>
<td width='100' height='70' bgcolor=#<%=cellCol%>><img src='car/car_thumbnails/<%=thumbnail%>' name='Image1' width='100' height='70' border='0' id='Image1'></a></td>
<%
end if
%>

Marcus Dunkus
09-22-2005, 12:21 PM
Excellent thanks,
I also tried this which worked:
if sold= "yes" then
Response.write"<td width='100' height='70' bgcolor=#"&cellCol& " <img src='car/car_thumbnails/accordw.jpg' name='Image1' width='100' height='70' border='0' id='Image1'></a></td>"
end if %>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum