Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2005
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    nested <% %> tags?

    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

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts
    u can't.
    u should use the following :
    <% if sold= "yes" then
    Response.write"<td width='100' height='70' bgcolor=#" & cellCol & ">>..."

    end if
    %>
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

  • #3
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    you can also do:
    Code:
    <% 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
    %>

  • #4
    New Coder
    Join Date
    Feb 2005
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 %>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •