ASP 101 - Active Server Pages 101 - Web03
The Place ASP Developers Go!

Please visit our partners


Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash




Script Output:
id text_field integer_field date_time_field
1117440 Thursday 8 1/8/2009 6:19:39 AM
1117441 Thursday 8 1/8/2009 6:39:25 AM
1117442 Thursday 8 1/8/2009 6:55:08 AM
1117443 Thursday 8 1/8/2009 7:02:37 AM
1117444 Thursday 8 1/8/2009 7:07:17 AM
1117445 Thursday 8 1/8/2009 7:07:33 AM
1117446 Thursday 8 1/8/2009 7:24:26 AM
1117447 Thursday 8 1/8/2009 7:41:33 AM
1117448 Thursday 8 1/8/2009 8:05:52 AM

To see the highlighting in action, try mousing over the rows of the table.


ASP HTML Download            FAQ

ASP.NET Version

Leave it to our readers to come up with another great idea. Instead of me rehashing the idea... here's the email message that I received:

This is a quick and nasty, but I use something like this for displaying rows of database output, so that they can be in alternate backgrounds similar to say old computer paper. I also have a pink highlighter line as you scroll down the database with your mouse. I use this function in the include part of the the ASP page so that I can use it anywhere on the site. You may need to tidy this script up a little as I said its cheap and nasty.

Instead of using <tr> I just use <%=Newline%>

Always remember to use Dim Seed at the top of of the ASP Page.

The new line script can be made more elegant by using CSS with border etc etc.

Works for me, others might find it useful.

Function NewLine
    if seed = 1 then
        newline = "<tr bgcolor ='lavender' " _
            & "onMouseover="&chr(34)&"this.bgColor= 'pink' "&chr(34)&" " _
            & "onMouseout="&chr(34)&"this.bgColor='lavender'"&chr(34)&" >"
        seed = 0
    else
        newline = "<tr bgcolor ='white' " _
            & "onMouseover="&chr(34)&"this.bgColor= 'pink' "&chr(34)&" " _
            & "onMouseout="&chr(34)&"this.bgColor='white'"&chr(34)&" >"
        seed = 1
    end if
End Function

Lawrence Edelstein

The idea of making it a function for reuse is good, but for the sample, I simply implemented the concept inline with the code in order to keep things simple. I also switched the highlight color to yellow since it matches our color scheme better, but when you look at the code you'll get the idea.


Samples

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers