Getting problems when you upload your Ajax Control Toolkit powered website up to your server? Read on for a quick and easy solution!
If you have added some of the Ajax Control Toolkit extenders into your website you will have probably tested them out on your local dev computer and marvelled at how easy it was to add some impressive eye candy to your site. Then, just when you think your work is done for the day and its time to put your new creation online you are hit with an error:
Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=18.104.22.168, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Well you don't need to worry too much because this time it is a really simple fix.
If your site has just broken and you want to get it running quickly then the simplest solution is to change your <cc1:ToolkitScriptManager> tag to be just a plain <asp:ScriptManager> tag.
So its as simple as taking your code
<cc1:ToolkitScriptManager runat="server" ... />
and changing it to
<asp:ScriptManager runat="server" ... />
(You might have a different prefix than cc1 but it doesn't matter).
The Real Fix
The real reason that your site is throwing the error is that the latest version of Ajax Control Toolkit expects to have a .net 3.5 SP1 runtime environment. The key bit here is the SP1 which means Service Pack 1.
To fix it you simply need to install the SP1 release which can be downloaded from here:
This needs to be run on your server so you will need remote desktop access to do this. This kind of control over your server is typically only available with dedicated servers or VPS virtual servers.
If you have a simple shared hosting package then you need to contact your web host and find out why they haven't upgraded yet. The SP1 release was a major upgrade which not only has many bug fixes included in it but also some great new features such as ASP.NET Dynamic Data. You can read all about the new features on the download link above.
In the worst case scenario where you cant get your host to upgrade and you cant move hosts because you are locked into a contract with them then you can at least fall back on the quick fix listed in the middle of this article to get your site running again.