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




ASP.NET "Database Highlight" Sample


When I started trying to implement last week's database row highlighting sample in ASP.NET, I naturally looked for a simple and elegant solution. When I was unable to come up with one easily on my own, I went to the web. Surely someone had done this before. The answer was bound to be out there just waiting for me to find it. Well I found plenty of answers, but none of them were very simple, let alone elegant.

The best of what I found came from the place I usually end up finding the best stuff... 4GuysFromRolla. Both Creating a Row-Selectable DataGrid Control and An Easier Way to Highlight the Rows of a DataGrid on MouseOver address the issue at hand and actually do a pretty good job. The problem is that the first is relatively complicated (it creates a new custom control which inherits from the DataGrid to get the job done) and the second has some compatibility issues (which stem from the author's desire to use CSS even though the lack of support for it forces him to use JavaScript to back it up anyway). While the solutions presented in those articles are probably technically "better" then my approach (the reusability and added functionality of the custom control in particular are big benefits), I wanted something simple (I'd long since given up on any level of elegance).

So here it is... the secret to getting simple database row highlighting in ASP.NET -- don't use the DataGrid! Instead of trying to wrangle the JavaScript into the table that the DataGrid generates, I just used the Repeater instead and built my own table. It may not be the coolest or most exciting approach (and we already know it's not the most elegant), but it's pretty darn simple. Just take a look at the code...

Here's a zip file of the code (1 KB).

Play with the running version.

View the live source code.


Back to the "Database Highlight" sample


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