ASP 101 - Active Server Pages 101 - Web05
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

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
1204667 Saturday 25 12/25/2010 12:08:05 AM
1204668 Saturday 25 12/25/2010 12:08:48 AM
1204669 Saturday 25 12/25/2010 12:10:58 AM
1204670 Saturday 25 12/25/2010 12:11:06 AM
1204671 Saturday 25 12/25/2010 1:03:30 AM
1204672 Saturday 25 12/25/2010 1:08:59 AM
1204673 Saturday 25 12/25/2010 1:34:27 AM
1204675 Saturday 25 12/25/2010 3:14:06 AM
1204676 Saturday 25 12/25/2010 3:14:09 AM
1204679 Saturday 25 12/25/2010 3:14:29 AM
1204680 Saturday 25 12/25/2010 3:14:37 AM
1204681 Saturday 25 12/25/2010 3:14:40 AM
1204682 Saturday 25 12/25/2010 3:14:43 AM
1204683 Saturday 25 12/25/2010 6:30:29 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.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers