当前位置: 代码迷 >> ASP.NET >> ASP.NET 2.0 AJAX 如何在原有项目中使用
  详细解决方案

ASP.NET 2.0 AJAX 如何在原有项目中使用

热度:3142   发布时间:2013-02-25 00:00:00.0
ASP.NET 2.0 AJAX 怎么在原有项目中使用
我把那三个dll文件复制到bin文件夹了
AJAXExtensionsToolbox.dll
System.Web.Extensions.Design.dll
System.Web.Extensions.dll

也根据web.config进行了修改
但还是很多问题
包括消息
未能找到元素“system.web.extensions”的架构信息。
未能找到属性“validateIntegratedModeConfiguration”的架构信息。
等等

到底怎么搞啊

------解决方案--------------------------------------------------------
新建一个Ajax toolkit 项目,把你以前项目除web.config以外所有的文件覆盖到新项目,然后把你项目的web.config里的条目,一条一条粘贴到Ajax toolkit项目的web.config中,编译,就ok了~!
------解决方案--------------------------------------------------------
就是ASP.NET AJAX-enabled Web site

------解决方案--------------------------------------------------------
大体的意思就是说,如果建的是ASP.NET AJAX-enabled Web site,会在web.config文件里面多些内容,别的也没什么差别,先把这些多出来的东东弄到你原来项目的web.config文件中去,

然后,在你的项目中 引用 然后在工具箱中选择,保证你的工具箱里出现那些控件们

然后就拖上去,然后把需要ajax效果的div之类的放进去,然后设置一下哪些事件响应,就行了
------解决方案--------------------------------------------------------
你自己复制进去不好使,要引用,然后添加工具箱里
------解决方案--------------------------------------------------------
你要安装ASPAJAXExtSetup.msi
------解决方案--------------------------------------------------------
这个是asp.net 2.0 ajax的配置文件,参考修改,注意大小写,.net对大小写要求非常严格
XML code
<?xml version="1.0"?><configuration>  <configSections>    <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>  </configSections>  <system.web>    <pages>      <controls>        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>      </controls>    </pages>    <!--          Set compilation debug="true" to insert debugging          symbols into the compiled page. Because this          affects performance, set this value to true only          during development.    -->    <compilation debug="false">      <assemblies>        <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>      </assemblies>    </compilation>    <httpHandlers>      <remove verb="*" path="*.asmx"/>      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>    </httpHandlers>    <httpModules>      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>    </httpModules>  </system.web>  <system.web.extensions>    <scripting>      <webServices>      <!-- Uncomment this line to customize maxJsonLength and add a custom converter -->      <!--      <jsonSerialization maxJsonLength="500">        <converters>          <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>        </converters>      </jsonSerialization>      -->      <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->      <!--        <authenticationService enabled="true" requireSSL = "true|false"/>      -->      <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved           and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and           writeAccessProperties attributes. -->      <!--      <profileService enabled="true"                      readAccessProperties="propertyname1,propertyname2"                      writeAccessProperties="propertyname1,propertyname2" />      -->      </webServices>      <!--      <scriptResourceHandler enableCompression="true" enableCaching="true" />      -->    </scripting>  </system.web.extensions>  <system.webServer>    <validation validateIntegratedModeConfiguration="false"/>    <modules>      <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>    </modules>    <handlers>      <remove name="WebServiceHandlerFactory-Integrated" />      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"           type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"           type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />    </handlers>  </system.webServer></configuration>
  相关解决方案