Friday, November 4, 2011

ASP.NET runtime error: 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)

You will get this error when you have more then one AJAX Tool kit version install on the same computer. To solve this issue you need to add this code in you Web.config file.

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

<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" Culture="neutral"/>

<bindingRedirect oldVersion="1.0.61025.0" newVersion="3.5.0.0"/>
<publisherProfile apply="no"/>

</dependentAssembly>
</assemblyBinding>

</runtime>

This will tell the application at run time which verison of the AJAX to use.

2 comments:

  1. I read your blog.I thought it was great.. Hope you have a great day. God bless.

    Rica
    www.imarksweb.org

    ReplyDelete
  2. Wow! I spent hours on this today. I am not sure why but I have always had trouble with these AJAX controls getting them to work properly. I could not even get a clean compile because of this error. One thing that I will mention is that this snipped needs to go right below the configuration section of web.config; not in one of the sub elements such as compilation, pages, etc. I do not why but the Microsoft AJAX runtimes have always proven to be quirky when incorporating into a .Net Solution. You would think that both being Microsoft products they would integrate more seamlessly. Anyway, thank you for submitting. This was a tremendous help. -- Grady Christie www.gradychristie.com

    ReplyDelete