Working with different versions of AjaxControlToolkit in Visual Studio 2010
When working with different versions of AjaxControlToolkit, Visual Studio 2010 contains some interesting improvements compared to previous versions of Visual Studio.
When adding a particular version of AjaxControlToolkit controls (or other similar third-party controls) to the toolbox using the Choose Toolbox Items dialog, we now show the version number of the control that is being added.
Once various versions of these AjaxControlToolkit (ACT) controls such as ACT 3.0 and ACT 4.0 are added to the toolbox in separate tabs (one tab per version), only the latest applicable version of the ACT controls will display as visible in the toolbox. This reduces confusion when different versions of ACT are present. The version number of the control is also displayed as a tooltip for the control.
What does ‘latest applicable version’ mean? Assume we have a website targeting .NET 3.5 and using ACT 3.5 controls in the bin folder. We could add the ACT 3.5 controls as a toolbox tab and they will display in the toolbox, as shown in figure 2. Assuming ACT 3.5 is the only version of ACT controls available in the toolbox, if we change the target framework version of the website to .NET 4, the toolbox will still show ACT 3.5 controls as visible in the toolbox even though the website is now targeting .NET 4. The reason is that ACT 3.5 is ‘applicable’ in a 4.0 website and it’s the ‘latest’ version of ACT available in the toolbox. However, if we now add the ACT 4.0 controls to the toolbox in a separate tab, the ACT 3.5 controls will automatically become hidden and only the ACT 4.0 controls will be shown as visible in the toolbox (as ACT 4.0 is the latest applicable version now). Note that the recommended way is to use the version of ACT corresponding to the .NET framework version (eg: ACT 4.0 with .NET 4).
On the other hand, when the website is targeting .NET 3.5 and if both ACT 3.5 and ACT 4.0 have been added to the toolbox, it will be the ACT 3.5 controls that will show up as visible and ACT 4.0 controls will be hidden (as ACT 4.0 is not applicable to a .NET 3.5 website).
If we use Smart Tasks to invoke the Add Extender dialog, the version number of the available ACT control in toolbox will be displayed here as well as a tooltip.
Another improvement in VS 2010 over VS 2008 is that in VS 2008, we only supported ACT 3.5 in the designer (as far as Smart Tasks and “Add Extender/Delete Extender” dialogs go). If we tried to use ACT 1.0 (against .NET 2.0), the ACT controls rendered as non-visual controls at the bottom pane of the designer. Now in VS 2010, we have designer support when targeting all versions of the framework (.NET 2.0, 3.5, 4.0) for any applicable version of ACT.
Multi-targeting – Learn More
To learn about the multi-targeting capabilities of Visual Studio 2010, see our earlier blog posts and MSDN documentation:
- Visual Studio Multi-Targeting Overview (MSDN Documentation)
- Multi-targeting of web projects using Visual Studio 2010
- Targeting earlier .NET frameworks 2.0, 3.0, 3.5 using Visual Studio 2010
- Visual Studio 2010 Property Grid Filtering
- Framework .NET 3.5 Sp1 required for targeting frameworks 2.0, 3.0 or 3.5 (multi-targeting) using Visual Studio 2010
Bala Chirtsabesan | Visual Web Developer Team