SharePoint And Ajax Technology(4):基于Microsoft ASP.NET AJAX 3.5的扩展

今天准备继续研究 AJAX ,但是发现按照上一篇文章的步骤去扩展 SharePoint 2007 网站集后,网站报错,扩展不成功 -_-! 于是去网上搜了一下,发现问题出在我将开发环境升级到了 Visual Studio 2008 并安装了 VS2008 SP1 补丁,对应的 .net Framework 3.5 也升级到了 SP1 ,所以扩展起来也发生了一些变化,同样在 http://www.telerik.com 找到了提供扩展方案。再转述一遍吧。
还是首先打开 SharePoint 2007 网站集对应的 web.config 文件,对其进行修改扩展。
1 .在 < configSections > 节点添加如下配置信息,可以看到组件版本都升级到了 3.5
    < sectionGroup name = "system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      < sectionGroup name = "scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        < section name = "scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
        < sectionGroup name = "webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          < section name = "jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
          < section name = "profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          < section name = "authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          < section name = "roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        </ sectionGroup >
      </ sectionGroup >
    </ sectionGroup >
2 .找到 < system.web > 节点,在其中的 < pages > 中添加如下配置信息,这里不但版本有所升级,而且多添加了一个命名空间 System.Web.UI.WebControls
      < controls >
        < add tagPrefix = "asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        < add tagPrefix = "asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35"/>
      </ controls >
3 .继续在 < system.web > 节点下寻找 < compilation > 节点,找到 < compilation > 后可以在其子节点下找到 < assemblies > ,在其中添加如下配置信息,这里也是除了版本升级多添加了 3 个组件。
        < add assembly = "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        < add assembly = "System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        < add assembly = "System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        < add assembly = "System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
4 .在 < system.web > < httpHandlers > 中添加如下配置信息,这里组件作了版本升级
      < add verb = "*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      < add verb = "*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      < add verb = "GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
5 .继续在 < httpModules > 中添加如下配置信息,这里同样配置版本升级
      < add name = "ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
 

本文出自 “努力学习的小熊” 博客,转载请与作者联系!

你可能感兴趣的:(Ajax,Microsoft,休闲,and,Technology)