我有一个两天前工作正常的网络应用程序。当我将此网站移动到另一台机器时,然后面临以下问题。
在我的网页中,我已将ScriptManager声明为:
<asp:ScriptManager ID="scriptMgr" runat="server">
</asp:ScriptManager>
当我访问网页时,我收到此错误:
The base class includes the field 'scriptMgr', but its type (System.Web.UI.ScriptManager) is not compatible with the type of control (System.Web.UI.ScriptManager).
在另一个网页上,我收到以下错误:
The base class includes the field 'upProgress', but its type (System.Web.UI.UpdateProgress) is not compatible with the type of control (System.Web.UI.UpdateProgress).
我的Web应用程序是基于ASP.NET 2.0构建的,我还验证了我的应用程序的bin文件夹中存在正确的(1.0.61025.0)版本的System.Web.Extensions.Dll。
web.config中System.Web.Extensions.Dll的条目是:
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="CSI.OLS.Library.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
</sectionGroup>
</sectionGroup>
</sectionGroup>
似乎这两个错误都与使用AJAX功能有关。谁能告诉我,可能导致上述错误的原因是什么?
答案 0 :(得分:0)
asp.net 2.0是否需要扩展补丁来正确支持ajax应用程序?
答案 1 :(得分:0)
这似乎是.NET 2.0 AJAX 1.0与.NET 3.5 AJAX问题。 (IE,AJAX库直接包含在.NET 3.5中,看起来你正在尝试使用.NET 3.5版本的AJAX库。)
我在应用程序中遇到了同样的问题,发现了this对该问题的引用,提出了两个解决问题的建议。
一个建议是在项目文件中引用System.Web.Extensions.dll程序集,将特定版本属性设置为 True 。由于您明确引用了此程序集的1.0.61025.0版本,我怀疑这可以解决问题。
答案 2 :(得分:0)
迟到的答案:)但我的产品遇到了类似的问题并通过在web.config中添加以下内容来解决它
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly>
</assemblyBinding>
</runtime>
这会重定向程序集绑定,以便使用新版本,从而解决冲突