Search This Blog

Thursday, November 04, 2010

Issues with ajax controls when upgrading from VS 2005 to VS 2008

Issues with ajax controls when upgrading from VS 2005 to VS 2008:

I have developed a website in Visual Studion 2005 (I mean to say DotNet Framework 2.0). I have used ajaxcontroltoolkit and developed ajax enabled website with all the ajax controls (e.g., accordian, asynchronous fileupload, calender extender etc). But I then realized the advantages of DotNet Framework 3.5 , So I just installed VS 2008 and opened my previous project in VS 2008. It asked me to convert to .NET framework 3.5, I just clicked next ->next and completed the conversion.

But then the problem raised with the ajax. Following may be the list of errors you may face when build the project in VS 2008.

A ScriptManager is required on the page to use ASP.NET AJAX Script Components. - error

Unable to cast object of type 'System.Web.Configuration.ScriptingAuthenticationServiceSection' to type 'System.Web.Configuration.ScriptingAuthenticationServiceSection'.

The base class includes the field 'ScriptManager1',
but its type (System.Web.UI.ScriptManager) is not compatible with the type of control (System.Web.UI.ScriptManager).

The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

Could not load file or assembly 'System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

For different scenarios you may get different errors. But most of them are because of the wrong upgradation from visual studion 2005 to visual studio 2008 if you are using ajax.

As we all know, AjaxControlToolkit is divided into two parts. One for .NET Framework 2.0 and another for .NET Framework3.5. An ajax-enabled website works depend on ASP.NET Ajax Extensions. It is integraded into .NET Framework3.5. But when your application works on .NET Framework 2.0, you need to install the ASP.NET AJAX Extensions 1.0 externally.

If your application has Ajax Control Toolkit controls, the right edition of AjaxControlToolkit.dll shoud be referenced. When we upgrade a web application which works on .NET Framework 2.0 to .NET Framework 3.5, we need to follow the VS upgrade guide to replace the wrong AjaxControlToolkit.dll edition. The replaced web.config should look like this. Copy and paste the following web.config with your current using web.config file, your application runs normally.

(NOTE: Some cases, this solution may not work in the expected manner. So I would request you to please take a backup of your web.config file, because if this doesn't work please revert back to your old web.config file)

No comments:

Post a Comment

Leave your suggession & comment...