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"/>
相關文章
相關標籤/搜索