Bug in Microsoft ASP.NET AJAX Extensions 1.0

Here’s the story:

I created a drop-down calendar control for a website I’m helping to build at work. The website needs to work not only with American date formats, but in British, French, Italian, German and Spanish formats as well, including a format which includes the three-letter abbreviation for the month (e.g., 31-Dec-2007). The Date.parse function built into the browser cannot parse this particular format, so I was hoping to leverage the localization features of the AJAX Extensions library. However, I kept getting an error at a function called “Sys$CultureInfo$_getAbbrMonthIndex”, deep in the bowels of the library. Here’s the entire function (line breaks added):

    function Sys$CultureInfo$_getAbbrMonthIndex(value) {
        if (!this._upperAbbrMonths) {
            this._upperAbbrMonths = this._toUpperArray(
                this.dateTimeFormat.AbbreviatedMonthNames);
        }
        return Array.indexOf(this._upperMonths,
            this._toUpper(value));
    }

Can you spot the error? Hello!? It populates an array called _upperAbbrMonths, then promptly looks for an entry in the _upperMonths array. Suffice it to say, if that particular field has not been defined yet, you get a variable undefined error. I fixed it by registering a startup script in our base Page class with the following script:

Sys.CultureInfo.prototype._getAbbrMonthIndex = function(value)
{
        if (!this._upperAbbrMonths) {
            this._upperAbbrMonths = this._toUpperArray(
                this.dateTimeFormat.AbbreviatedMonthNames);
        }
        return Array.indexOf(this._upperAbbrMonths,
            this._toUpper(value));
};

That fixes the bug. The interesting this is that this bug is “fixed” according to MS, because the new version of the library produced in .NET 3.5 has it fixed. Of course, if you’re stuck in .NET 2.0, you’re SOL.

links for 2007-06-09

links for 2007-05-29

links for 2007-05-26

“Project not found” problem loading a Solution with a web services project in Visual Studio.NET 2003

So, I was getting this error constantly at work and found the solution on the web. I’m reproducing here without permission so that I know it will exist where I can find it.

Original: Blogs - “Project not found” problem loading a Solution with a web services project in Visual Studio.NET 2003

  1. Copy the files from the Visual SourceSafe database to your local computer.
  2. Create the virtual directory for the web services project manually and point it to the desired directory. Configure the application & script execution settings (IIS) (no application name etc).
  3. Locate the <project>.vbproj file in IIS by clicking on the virtual directory and displaying the contents and delete it.
  4. Open VS.NET and open the solution from visual source safe.
  5. When prompted for the location of the web service project, select the virtual directory you have created for the web services project and hit OK.

Visual Studio will extract a new copy of the .vbproj file into the Virtual Directory and your solution should now work as expected.