Sunday, May 14, 2006
Matt Hawley has been working around the clock, it seems, and has publicly released v2.0 of his free ASP.NET server controls.  Controls included:

CalendarPopup a great calendar tool to allow users to choose a date
CollapsablePanel a panel that can be collapsed on the client
FaqRepeater databound FAQ-style listing control
ListTransfer (re-order listbox or move items from one listbox to another)
MaskedTextBox add a masked textbox to your forms
MultiTextDropDownList drop-down list with multiple columns
MultiTextListBox listbox with multiple columns
NumericBox add a textbox that only accepts numerical input
TimePicker add time selections to a form

I believe that each of these controls are cross-browser compatible.  Download the release candidate and check them out!

Sunday, May 14, 2006 1:52:11 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Tuesday, May 02, 2006
ArgoSoft have just announced a free e-mail validation Web service, based on their years of experience with their Mail Server product.  Plug it into your ASP.NET app for real-time e-mail address verfication!

I've used ArgoSoft's Mail Server for years and have found it to be a great product at an unbeatable price.  ArgoSoft support has always been top-notch, as well.  Highly recommended.

Tuesday, May 02, 2006 3:31:06 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Wednesday, February 22, 2006
In case someone else would like to know how to create a singleton DataManager class for WilsonORMapper that uses IsolatedContext and works in ASP.NET...

View DataManager.cs

using System.Configuration;
using System.IO;
using System.Reflection;
using System.Web;
using Wilson.ORMapper;

namespace Portal.Data
{
    /// <summary>
    /// The DataManager class is the singleton instance of the ObjectSpace class
    /// </summary>
    public sealed class DataManager
    {
        private const string MAPPING_FILE = "Mapping.config";
        private static readonly Guid CONTEXT_KEY = Guid.NewGuid();
        
        /// <summary>The application connection string read from app.config</summary>        
        /// <example>
        /// Add the following key to the "appSettings" section of your config:
        /// <code><![CDATA[
        ///     <configuration>
        ///            <appSettings>
        ///                <add key="IMI.Portal.Framework.Data.ConnectionString" value="Data Source=(local);Initial Catalog=DATABASE;User ID=USERNAME;Password=PASSWORD;" />
        ///            </appSettings>
        ///     </configuration>
        /// ]]></code>
        /// </example>
        public static readonly string ConnectionString = ConfigurationSettings.AppSettings["ConnectionString"];
        public static readonly string CurrentProvider = ConfigurationSettings.AppSettings["Provider"];

        /// <summary>The singletion instance of an ObjectSpace Class</summary>
        private static ObjectSpace objectSpace; // = GetDefaultInstance();
        private static object syncLock = new object();

        private DataManager()
        { }

        #region public static ObjectSpace ObjectSpace

        /// <summary>The singleton method for retrieving the global ObjectSpace</summary>
        public static ObjectSpace ObjectSpace
        {
            get
            {
                if (objectSpace == null)
                {
                    lock (syncLock)
                    {
                        if (objectSpace == null)
                        {
                            objectSpace = GetDefaultInstance();
                        }
                    }
                }
                
                HttpContext context = HttpContext.Current;
                if (context != null)
                {
                    ObjectSpace isolatedContext = (ObjectSpace) context.Items[CONTEXT_KEY];
                    if (isolatedContext == null)
                    {
                        // Cache the isolated context in the current request so that it is used
                        // throughout the entire request

                        isolatedContext = objectSpace.IsolatedContext;
                        context.Items[CONTEXT_KEY] = isolatedContext;
                    }
                    return isolatedContext;
                }
                else
                {
                    return objectSpace;
                }
            }
        }

        #endregion

        #region private static ObjectSpace GetDefaultInstance()

        private static ObjectSpace GetDefaultInstance()
        {
            Assembly assembly = Assembly.GetAssembly(typeof(DataManager));
            
            using (Stream mappingStream = assembly.GetManifestResourceStream(
                typeof(DataManager),
                MAPPING_FILE))
            {

                switch(CurrentProvider)
                {
                    case "MySQL":

                        return new ObjectSpace(
                            mappingStream,
                            ConnectionString,
                            GetMySQLProvider(),
                            20, 5);

                    case "PostgreSQL":

                        return new ObjectSpace(
                            mappingStream,
                            ConnectionString,
                            GetPostgreSQLProvider(),
                            20, 5);

                    // TODO: Oracle?

                    default:

                        return new ObjectSpace(
                            mappingStream,
                            ConnectionString,
                            Provider.MsSql,
                            20, 5);

                }
                
            }
        }

        #endregion

        #region private static CustomProvider GetMySQLProvider()

        private static CustomProvider GetMySQLProvider()
        {
            //Provider provider;
            CustomProvider provider;
            provider=new CustomProvider("MySql.Data", "MySql.Data.MySqlClient.MySqlConnection", "MySql.Data.MySqlClient.MySqlDataAdapter");
            provider.StartDelimiter="";
            provider.EndDelimiter="";
            provider.LineTerminator=";";
            provider.IdentityQuery= "SELECT LAST_INSERT_ID()";
            provider.SelectPageQuery="SELECT * LIMIT {0} OFFSET {1}";
            provider.ParameterPrefix = "?";
            provider.GuidDelimiter = "'";

            return provider;
            
        }

        #endregion

        #region private static CustomProvider GetPostgreSQLProvider()

        private static CustomProvider GetPostgreSQLProvider()
        {
            // Npgsql, the .NET provider for PostgreSQL can be found here:
            // http://pgfoundry.org/projects/npgsql

            CustomProvider provider;
            provider=new CustomProvider("Npgsql", "Npgsql.NpgsqlConnection", "Npgsql.NpgsqlDataAdapter");
            provider.StartDelimiter="[";
            provider.EndDelimiter="]";
            provider.LineTerminator=";";
            provider.IdentityQuery= "SELECT currval('{1}_{0}_seq')";
            provider.SelectPageQuery="SELECT * LIMIT {0} OFFSET {1}";
            provider.ParameterPrefix = ":";
            //not sure about this
            provider.GuidDelimiter = "'";

            return provider;
            
        }

        #endregion
    }
}
       
Wednesday, February 22, 2006 8:43:01 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Saturday, February 18, 2006
Version 0.9.2 of MySQLSchemaProvider for CodeSmith and MySQL 5.0 is now available for download.  Changes include:
  • Updated GetTableKeys() to provide not only the foreign keys for the table but also the foreign keys of other tables that point to the given table. Code update graciously provided by Dug Steen.  Thanks!
  • Added .NET 2.0 version for CodeSmith 3.2.5 or higher
  • .NET 1.1 version requires CodeSmith 3.1.6
Keep in mind that the version requirements are for the assemblies that ship with the current download.  If you are using a previous 3.xx version of CodeSmith, you can simply recompile from the source code and it should work.

Saturday, February 18, 2006 12:38:57 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [3]  | 
 Tuesday, February 14, 2006
Yahoo! has released a free library of AJAX-enabled UI components, including a set of core utilities for animation, drag-and-drop, events, DOM, as well as calendar, slider, and treeview controls.  The components are both free and open-source under a BSD license.

Also noteworthy is the new Yahoo! Design Pattern Library.  Here they attempt to demonstrate UI best practices for the Web including breadcrumbs, pagination, and other common UI elements.  This is their first installment of what they promise to be a monthly installment of the latest Web patterns and practices.

Tuesday, February 14, 2006 12:24:25 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Friday, February 10, 2006
Great news for ASP.NET developers.  After joining Microsoft, Matt Hawley had to stop distributing his great ASP.NET server controls.  After 10 long months, he's finally been given permission to start distributing them again.  My company and I have used his pop-up calendar control.  I also use Unleash It (unaffected by the blackout) to deploy web applications, and it is fantastic.  Thank you Matt, and thanks for listening, Microsoft!

Friday, February 10, 2006 4:16:07 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Friday, January 27, 2006
ComponentArt announced yesterday their new beta Web.UI 2006 suite.  Included are two new controls: WebChart Lite for ASP.NET and Splitter for ASP.NET.  I had a chance to install the beta today and play around with the demos.  Once again, ComponentArt have outdone themselves.

WebChart Lite has all the features and API of its WebChart for ASP.NET big brother, but only supports 2-D charts.  Actually, from what I've seen, WebChart Lite will generate 3-D charts, but they are rendered with ComponentArt watermark.  I think it is outstanding that ComponentArt chose to provide WebChart Lite to its Web.UI subscription customers.  I'll also add that the licensing for the full version is quite reasonable when compared to some of the other charting components on the market.

The new Splitter control is very impressive.  With it you can create resizable panels that can be split horizontally and vertically, and can also collapse and expand.  The Splitter "panes" can have minimum and maximum heights and widths, or can fill the entire window area.  Layouts can be changed dynamically.  The demos provided look like an RSS reader or e-mail client.  There aren't any online demos yet, but if you download the beta you can view the demos locally.  I can think of quite a few areas in my own applications where I'll be using this new control.

Web.UI 2006 will also include ASP.NET 2.0 versions of their controls with support for new features such as skins, themes, and the ASP.NET 2.0 navigation architecture.  Way to go, ComponentArt!

Friday, January 27, 2006 6:48:49 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Tuesday, January 24, 2006
A minor release, but looks like some major improvements, such as a new SQL Server 2005 provider that takes advantage of some new features for better performance.

I've plugged Paul Wilson's O/R Mapper before, but I don't think it would hurt to reiterate that it is a fantastic tool.  I strongly encourage you to take it for a real test run (read: complete a small but real-world application with it).  Reading the feature list and taking it for a quick spin just won't do it justice.  If you've not used an O/R mapper before, it takes a little time to adopt the right mindset.  However, I think the benefits will become very clear once you see what it is capable of.  The beauty of WilsonORMapper is in its simplicity. 

I also recommend you try Paul Welter's CodeSmith templates for WilsonORMapper.  You can point CodeSmith at your database and generate a complete set of business classes ready to handle just about everything you need to do.  I have not yet tried the new CodeSmith templates from Jason Bunting.

Full list of changes can be found on Paul's blog.

Tuesday, January 24, 2006 11:23:32 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Sunday, November 27, 2005
While recuperating from massive quantities of turkey and trimmings, I began work on a CodeSmith custom schema provider for MySQL 5.0

As Josh frequently says, “Nerd alert! Nerd alert!”

The journey has been quite a learning experience so far.  Creating a custom schema provider requires that you create a class that implements the IDbSchemaProvider interface.  This interface exposes a couple of properties and several methods required to query definitions for all tables, views, stored procedures, keys, indexes, and so forth.  Since I’m targeting MySQL 5.0, I’m using the new INFORMATION_SCHEMA support wherever possible.  The provider also depends on the latest MySQL Connector/Net.

Download ChristianASPNet.MySQLSchemaProvider version 0.90

Instructions:
  • Make sure you have MySQL Connector/Net 1.0.7 or later installed
  • Make sure CodeSmith is not running
  • Extract and copy the ChristianASPNet.MySQLSchemaProvider.dll assembly to /Program Files/CodeSmith/v3.0/SchemaProviders (or wherever you have CodeSmith installed)
The next time you run CodeSmith and create or modify a data source, MySQLSchemaProvider should now show up in the list of available Provider Types.

UPDATE (12/23/05):
Apparently you will need CodeSmith version 3.1.4 or later to use the assembly in the download.  You may be able to use a previous version of CodeSmith 3.xx if you compile the source yourself.  Also, be sure to use the following format for your MySQL provider connection string.

Server=localhost;Port=3306;Database=databaseName;Uid=userName;Pwd=userPassword

UPDATE (12/29/05): Download the latest version 0.91.

For more nerdy details, read on...

I’ve also included a simple SchemaTest.cst template that I created as I was writing the custom provider.  It doesn’t do anything special or even demonstrate best practices.  It’s just an ugly test harness. I include it in case you are interested in having a quick way to query the objects in your MySQL database.

There are a few methods I have not been able to implement (yet).  GetCommandParameters() returns parameter definitions for a given stored procedure.  MySQL 5.0 INFORMATION_SCHEMA does not support the PARAMETERS table at this time.  I tried to use MySQL Connector/Net’s MySqlCommandBuilder.DeriveParameters() method, which is supposed to work in version 1.0.7, but threw a NULL reference exception in my testing.

GetCommandResultSchemas() returns the schema of the result sets that are output from a given stored procedure.  However, if the stored procedure requires parameters, then we’re back to the previous issue.

I also chose not to implement GetExtendedProperties(), since I don’t yet know what would be relevant to a MySQL developer.  I am a MySQL newbie, after all.

Happy templating!
Sunday, November 27, 2005 11:50:00 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  | 
 Monday, November 21, 2005
New version 1.0.7 of the MySQL ADO.NET provider Connector/Net has been released.  From the press release:

MySQL Connector/Net 1.0.7, a new version of the fully-managed, ADO.Net provider for the MySQL database system has been released. This release is the latest production release of the 1.0 series and is suitable for use with any MySQL version including MySQL 4.1 or 5.0.
Continue...

The new version includes binaries for .NET 2.0, but they are simply compiles of the existing source code and do not take advantage of any new ADO.NET 2.0 features.

Download Connector/Net
Monday, November 21, 2005 1:05:00 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Friday, October 14, 2005

The guys at Telligent have been making some very cool news lately, such as hiring the gifted James Shaw, acquiring James' Dozing Dogs CMS to be leveraged in CS at some point, and supporting Ink.  As you may already know, I'm quite fond of ComponentArt's Web.UI suite, and was honored last December to be recognized as a ComponentArt MVP.  So, it's no surprise that I'm thrilled to hear that ComponentArt has partnered with Telligent to provide their Web.UI components to be used within Community Server.  This will certainly be a home run for both sides.  Congratulations!

Friday, October 14, 2005 10:50:00 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  | 
 Friday, October 07, 2005
To use FCKeditor in an ASP.NET project, you also need the FCKeditor.Net integration component.  Both the editor and the .NET component can be downloaded from the FCKeditor sourceforge project.  Next, follow the instructions found on the Developer's Guide for ASP.NET Integration to get the editor working in your .NET project.
Friday, October 07, 2005 1:21:00 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [6]  | 

From the FCKeditor web site:

"This new version is another important step to the project. The development now is concentrated on bug fixing and stability, so this update is highly recommended. There are also some interesting new features, like the “Protected Source”, that makes it possible to use server side code in the editor and the new keyboard handling for Firefox. "

http://www.fckeditor.com/whatsnew/default.html

Friday, October 07, 2005 6:49:00 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Friday, August 12, 2005

What a shame.  Matt Hawley, now a Microsoft employee, is being barred by the MS legal department from distributing his free library of ASP.NET components.  I've used these components in the past, and have found them to be fantastic tools.  Help support all the work that Matt has put into the ASP.NET community by signing the petition.

UPDATE: It appears that developer community's reaction is making a difference!

Friday, August 12, 2005 4:48:00 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Wednesday, August 03, 2005

I've been working on a sample tonight for one of my hosting customers showing how to create a "Contact Us" page in ASP.NET using System.Web.Mail.  Searching for examples of proper syntax, I came across System.Web.Mail, OH MY!  This is an exhaustive FAQ on using the built-in Mail framework library, including answers to common questions and problems, as well as advanced tips for adding functionality (such as SMTP authentication) that you may have thought not possible.

What I found especially interesting is that the site was created by Dave Wanta of 123Aspx fame, who also happens to sell a *very* good e-mail component for .NET named aspNetEmail.  He does include a shameless plug for his product buried in the FAQ.  After all, System.Web.Mail doesn't do everything.  But, to Dave's credit, he also lists a couple of other third-party tools and the entire site seems to be the best resource on the Web for using System.Web.Mail.  Kudos to Dave!

Wednesday, August 03, 2005 10:39:00 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  | 
 Monday, August 01, 2005

"The future's so bright, I gotta wear shades." -Timbuk 3

ComponentArt continues to just blow me away.  Last week they announced version 3.0 beta release of their Web.UI suite.  The new components added to the suite include Grid, Calendar and Callback (AJAX - Asynchronous JavaScript and XML) controls.  You can demo the new controls at webui30.componentart.com.  July 20, they announced the beta of their new Charting components for both WinForms (WinChart) and ASP.NET WebForms (WebChart).  I got two words for ya: Amaaaaa-zing.

The new Grid control renders a very rich interface, allowing the end-users to page, sort, group, filter, search, resize columns, and use the keyboard.  The grid can operate in server, client and callback modes.  When using callback mode for a large set of data, your users can retrieve a page of data at a time without the page having to refresh, yet still have complete control over sorting, grouping, filtering, and so on.

Callback for ASP.NET claims to deliver AJAX-style functionality to any server-side control, giving the developer a clean and elegant way of providing user interfaces that can dynamically change without ever refreshing or "posting back" the current page.

The demos for the new Charting components are spectacular.  Also, check out all the features provided.  Although the charting components will be sold separately from the Web.UI suite, there's still good news for Web.UI subscribers.  According to this post in their product forums, a "WebChart Lite" control will eventually be provided to Web.UI subscribers at no additional cost.

Monday, August 01, 2005 7:28:00 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |