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
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
1054134 Saturday 5 7/5/2008 5:49:26 AM
1054135 Saturday 5 7/5/2008 5:50:27 AM
1054137 Saturday 5 7/5/2008 5:20:16 AM
1054138 Saturday 5 7/5/2008 5:31:06 AM
1054139 Saturday 5 7/5/2008 5:58:52 AM
1054140 Saturday 5 7/5/2008 7:07:39 AM
1054141 Saturday 5 7/5/2008 7:07:42 AM
1054142 Saturday 5 7/5/2008 7:15:56 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



JupiterOnlineMedia

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

Solutions
Whitepapers and eBooks
IBM eBook: Planning a Service Oriented Architecture
IBM eBook: Choosing the Right Architecture--What It Means for You and Your Business
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Avaya Article: Using Intelligent Presence to Create Smarter Business Applications
Intel Go Parallel Article: Getting Started with TBB on Windows
Microsoft Article: 7.0, Microsoft's Lucky Version?
Avaya Article: How to Feed Data into the Avaya Event Processor
IBM Article: Developing a Software Policy for Your Organization
Microsoft Article: Managing Virtual Machines with Microsoft System Center
Intel Go Parallel Article: Intel Threading Tools and OpenMP
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
HP Video: StorageWorks EVA4400 and Oracle
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Red Gate Download: SQL Toolbelt and free High-Performance SQL Code eBook
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
Silverlight 2 App and Walkthrough: Leverage Silverlight 2 with SQL Server and XML
IBM Article: Enterprise Search--Do You Know What's Out There?
HP Demo: StorageWorks EVA4400
Microsoft Article: The Progress and Promise of Deep Zoom
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES