Tuesday, December 24, 2013

The type or namespace name 'AjaxControlToolkit' could not be found in the global namespace

The type or namespace name 'AjaxControlToolkit' could not be found in the global namespace (are you missing an assembly reference?)

Most of the times when we are using Ajax Control Toolkit  we are getting an error when compiling our web application I've added the toolkit countless times before but for some reason, I keep getting this. How can I resolve this issue so I can use the toolkit? It is recommended to add reference to the AjaxControlToolkit.dll(right click on the bin directory, and choose "Add Reference"), and then AjaxControlToolkit.dll will be added to the bin directory automatically. But even after adding the reference to AjaxControlToolkit the project was complaining that "The type or namespace name 'AjaxControlToolkit' could not be found (are you missing a using directive or an assembly reference?)". How to solve this. The answer is that the project is still using Microsoft ASP.NET 2.0 AJAX Extensions 1.0 so it can not use .net v3.5 or above. So how to fix? Turns out that the toolkit relies on 2 additional assemblies, these are:
System.Web.Extensions.dll
System.Web.Extensions.Design.dll
See in your Refrences if both of these are present. You can download these files from here