Here's another new toy I stumbled upon - the new AutoCollage tool from Microsoft Research. This is a very easy-to-use image processing program which will automatically create a polished collage from a folder of your favorite pics.

AutoCollage 2008


This is a really handy way to create personalized Christmas cards on the fly and avoid the shopping lines at the mall! All you have to do is pick a folder and click a button. Download the one month trial here.

AutoCollage 2008


Here's a short video presentation of AutoCollage in action :-)

Bind CheckBoxList to DataSet

by agrace 12. October 2008 07:48

Bind CheckBoxList to DataSet


Here's a code sample that might come in handy. This is a CheckBoxList for a fictitious Real Estate broker who wishes to maintain a list of features for each property listing entered in the system. Typically, you would create a form to add a listing and another to edit an existing listing. Loading the selected values for a CheckBoxList from the database often causes confusion and this snippet uses a Non-Typed-DataSet and a stored procedure.

CheckBoxList Data Table


CheckBoxList Markup


You may notice that there is also a custom validator used, to ensure that at least one selection has been made in the CheckBoxList. It would be nice to add a JavaScript version of this on the client also. The following snippet is part of the page load method.

CheckBoxList Validation


Here's the code to grab the selected values from the in-memory DataSet...

CheckBoxList Code


This is the call to the stored procedure from the DALC (Data Access Layer Class); the business layer method is simply a pass-through call.

CheckBoxList DALC


Next up is a pretty basic stored procedure which simply grabs the fields containing the text for the ChekBoxList items and the corresponding boolean value, indicating whether or not they were originally selected.

CheckBoxList Stored Procedure

RIA Scott Guthrie has just announced that Microsoft is going to include the JQuery JavaScript library as part of Visual Studio 2008 SP1 and the free Visual Web Developer 2008 Express SP1. JQuery is has quickly become the most popular JavaScript library out there, despite the competition and weighs in at only 15KB.

On the face of it, this is an unprecedented move by Microsoft. Nobody would have even dreamed of seeing an open source project being adopted by the Big M... exciting times! They are going to make it an integral part of their own framework and build upon it in the shape of controls for the ASP.NET AJAX Control Toolkit and new Ajax server-side helper methods for ASP.NET MVC.

My achilles heel as a developer has always been my limited knowledge of JavaScript but I recently took steps to immerse myself in it. Having JQuery to build upon is like getting Christmas early and should provide some great fun and excitement over the coming few years as we start to construct richer and more creative Web experiences.

Some JQuery Resources:

    * 10 Smart JavaScript Techniques
    * 10 Useful JQuery Plugins
    * Comparing Popular JavaScript/AJAX Frameworks
    * JQuery Documentation
    * JQuery Selectors Reference Card (PDF)