Archive for the 'Ajax' Category

Ajax Control Toolkit - AutoComplete bug fix for numeric values

In this post we described a bug in the Ajax Control Toolkit v1.0.10920 that caused the AutoComplete Extender to behave incorrectly. The main problem was that we were getting ‘undefined’ as the list of suggested words when using purely numeric values, as shown in the following figure:

toolkit_issue2

Fortunately, the Ajax Toolkit Team managed to solve the issue in changeset 27752 so we do not get the list of ‘undefined’ options anymore*.

toolkit_issue2_fixed

Download Ajax Control Toolkit changeset 27752

Note: To use the new toolkit version, simply extract zip file, load the "AtlasControlToolkit-27752\Development\AjaxControlToolkit.sln" solution in Visual Studio and run it to generate the assemblies.

*However, take into account that the first issue mentioned in this post has not been solved yet (No autocomplete list is shown until you hit the backspace key).

How to: Run the Contextual AutoComplete Bundle with a newer version of the Ajax Control Toolkit

Symptom

When you use a newer version of the AjaxControlToolkit in the AutoComplete QuickStart, a runtime error occurs:

“Parser Error Message: Could not load file or assembly ‘AjaxControlToolkit, Version=1.0.10618.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e’ or one of its dependencies.”

parserError

Root Cause

Since the AjaxControlToolkit.dll assembly is strong named, you must use the same assembly version that the AjaxControlToolkit.WCSFExtensions was compiled against (because the CLR attempts to bind –by default- with the exact version of an assembly that the application was built with).

Workaround

(Note: I smoke tested the AutoComplete QuickStart with AjaxControlToolkit 1.0.10920.x and I faced some issues; therefore, I suggest you not to run the QuickStart with this version. Read the known issues section for more details.)

You can use assembly version redirection to avoid having to rebuild the AjaxControlToolkit.WCSFExtensions.dll assembly. With the redirection mechanism, you can tell the CLR to redirect one assembly version to another:

1) Copy AjaxControlToolkit.dll (and all the sub-directories) located in the SampleWebSite\Bin folder of the toolkit’s zip file to the Lib\AjaxControlToolkit folder of the QuickStart directory.

2) Open the AutoComplete QuickStart.

3) Add the following XML code to the AutoCompleteQuickStart Web.config file after the close tag. Replace the newVersion attribute to match the version of the AJAX Control Toolkit that you are using (for example, the current version is 1.0.10920.32880).

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

        <assemblyIdentity name="AjaxControlToolkit"
                          publicKeyToken="28f01b0e84b6d53e"
                          culture="neutral"/>
        <bindingRedirect oldVersion="1.0.10618.0"
                         newVersion="1.0.10920.32880"/>

Note: You can find the assembly version number in the properties of the reference to the AjaxControlToolkit assembly

AjaxControlToolkitVersion

4) Run the QuickStart.

 

AjaxControlToolkit (1.0.10920.x) issues

This section describes the issues faced when running the Autocomplete QuickStart with the AjaxControlToolkit 1.0.10920.x.

o No autocomplete list is shown until you hit the backspace key.

toolkit_issue1

o On Numeric fields, you get a list of “undefined” words. This seems to be related with an issue with this version of the the AjaxControlToolkit.

Note: This issue was resolved with changeset 27752. More information, go to here.

toolkit_issue2