If you know .NET then you probably know of Scott Gu. Chances are you read his blog and you may have even seen the post entitled “The asp:ListView control (Part 1 – Building a Product Listing Page with Clean CSS UI)”. This article was pivotal for me in realizing ASP.NET as viable web solution. This is…. outside of the enterprise. As far as I had been concerned .NET suffered from two major flaws which prevented it from being a viable solution for everyday projects.
1.) ASP.NET did not have a feature for generating the data access layer and helper methods (prior to 2008). Without which one must hand program every single property and method. To my dismay even more 3rd Party Tools (e.g. Codesmith, Subsonic, etc…) were required if one was ever to see his family again. This gripe, however, was happily satisfied by Subsonic. Subsonic is what I had envision .NET would be like when I first started migrating from scripting languages.
2.) ASP.NET HTML output was garbage. When I first saw the HTML rendered by .NET back in 2004 I almost vomited. To say the least it was simply unacceptable for anyone concerned with SEO and cleanliness. That is where the ListView and Scott Gu’s article came home. Listview has all the benefits of .NET, but outputs clean HTML or CSS code.
So with both of my major gripes solved the next natural step was to unite the two, Subsonic and Listivew together. That is when I set out to convert Mr. Gu’s LINQ project to Subsonic. It was a natural starting point and in the beginning it looked like a marriage made in heaven. It uses SQL 2005 paging techniques so it is very fast. It is Listview so the output is clean. Custom paging was a snap and I set out to add sorting and filtering.
Unfortunately, with all good things there are obstacles. It does not appear that the built in sorting capabilities of Listview work with Subsonic. These days I do not have much free time for research so may be awhile until I have a solution. If you’re interested in using this Listview with Subsonic sample, or if you’re up to the challenge of getting sorting to work, please download the project. I’d appreciate your comments. Cheers!
Note: The source is VB and requires the Northwind Database.
