Re: ASP

by "Keith Sellars" <Keith(at)webgraffix.com>

 Date:  Fri, 19 Apr 2002 14:28:58 -0400
 To:  <hwg-basics(at)hwg.org>,
"Matthew Ohlman" <matthew(at)ohlman.com>
 References:  ohlman
  todo: View Thread, Original
css isn't necessary.  It can be done in the programming language, asp in
this case.

In the code below, for each value the database returns, the snippet below is
parsed and alternates the row color.  Here is the code in php. I don't know
asp, but the idea should be the same:

*********BEGIN***************
 if ($lastColor == 1) {
  $lastColor = 0;
  } else {
  $lastColor = 1;
  }


  if ($lastColor == 1) {
  echo "<tr bgcolor=\"#B388D9\">";
  } elseif ($lastColor == 0) {
  echo "<tr bgcolor=\"#D5BCE9\">";
  }

*********END*************


----- Original Message -----
From: "Matthew Ohlman" <matthew(at)ohlman.com>
To: <hwg-basics(at)hwg.org>
Sent: Friday, April 19, 2002 1:56 PM
Subject: ASP


> Hi List. I have been searching the web but can't find
> an easy way to do this. I have made a script, that
> searches a database, and displays the results into
> a table. How do I make every other table row rotate
> in color? Do I use CSS for this?
>
> The code is like this:
>
> If Request.form("what") = "name" Then
> SqlDepost = SqlDeposit & "WHERE name LIKE'%"  & _
> Request.form("search")& "%'"
> End If
>
> ' Then the table is just a normal table with this in it:
>
> <%=rsGlobalWeb("Name")%>
>
>
> Hope my explanation is clear enough!
> Thanks in advance,
> Matthew
>
>
>
>
> | Matthew Ohlman
> | Ohlman Pages
> | http://www.ohlman.com/
> "There's a difference between a philosophy and a bumper sticker. "
>      Charles M. Schulz
>
>
>

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.