Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 10th, 2007, 08:54 PM
Authorized User
Points: 254, Level: 5
Points: 254, Level: 5 Points: 254, Level: 5 Points: 254, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2007
Location: , , .
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default Alternating colors in table

Folks, I need a little assistance. I've done this in the past but I can't remember how to do it. When I did a Google search for it, I was giving more complicated examples which I don't need because I already have the below.

What I want is for the ASP to change the <td bgcolor> when ever the rs("LOCATION") changes.

Can anyone help?

===================

<%do until rs.EOF%>

        <td><%response.write rs("LOCATION")%></td>
        <td><%response.write rs("NAME")%></td>
        <td><%response.write rs("NUMBER")%></td>

<%rs.MoveNext
loop
rs.close
conn.close%>



  #2 (permalink)  
Old March 11th, 2007, 02:59 AM
Authorized User
Points: 254, Level: 5
Points: 254, Level: 5 Points: 254, Level: 5 Points: 254, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2007
Location: , , .
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry guys, I figure it out. I can't believe I did this. I had the correct code but I was saving my updates in the wrong folder do it was never being read! Sometimes, it's just a matter of double checking ones work. Man do I feel stupid now!

  #3 (permalink)  
Old March 11th, 2007, 04:09 PM
Friend of Wrox
 
Join Date: May 2005
Location: , , Norway.
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...can you share the code with me, Crabjoe? Thank you!

Mvh
grstad
  #4 (permalink)  
Old March 12th, 2007, 09:28 AM
Authorized User
Points: 254, Level: 5
Points: 254, Level: 5 Points: 254, Level: 5 Points: 254, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2007
Location: , , .
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sure can grstad
======================

<%trcolor = "1"%>

<%do until rs.EOF%>

        <%If rowcolor<>rs("LOCATION") and trcolor="0" then
        trcolor ="1"
        rowcolor = rs("LOCATION")
        end if

        If rowcolor<>rs("LOCATION") and trcolor="1" then
        trcolor ="0"
        rowcolor = rs("LOCATION")
        end if%>

                <%if trcolor="1" then%>
                <tr bgcolor="#FFCC99">
                <%end if%>

                <%if trcolor="0" then%>
                <tr bgcolor="#FFFF99">
                <%end if%>

                    <td><%response.write rs("LOCATION")%></td>
                    <td><%response.write rs("NAME")%></td>
                    <td><%response.write rs("NUMBER")%></td>

<%rs.MoveNext
loop
rs.close
conn.close%>


Similar Threads
Thread Thread Starter Forum Replies Last Post
no colors when printing Hylsan Beginning PHP 0 May 28th, 2007 05:06 AM
Colors scandalous Access 1 February 8th, 2007 01:01 PM
Alternating Colors in ListBox rows nkrust ASP.NET 1.0 and 1.1 Basics 2 January 10th, 2007 03:27 PM
Alternating Colors in ListBox rows nkrust ASP.NET 1.0 and 1.1 Professional 1 January 10th, 2007 09:47 AM
alternating colours ozPATT Excel VBA 3 October 5th, 2005 10:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.