ASP 101 - Active Server Pages 101 - Web01
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
1111160 Monday 1 12/1/2008 12:18:48 PM
1111162 Monday 1 12/1/2008 12:24:50 PM
1111163 Monday 1 12/1/2008 12:49:55 PM
1111165 Monday 1 12/1/2008 12:53:04 PM
1111166 Monday 1 12/1/2008 1:11:49 PM
1111167 Monday 1 12/1/2008 1:18:07 PM

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

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES