">
首页 | 源码下载 | 网站模板 | 网页特效 | 广告代码 | 网页素材 | 字体下载 | 书库 | 站长工具
会员投稿 投稿指南 RSS订阅
当前位置:主页>网络编程>ajax教程>资讯:基于ASP.NET AJAX的WebPart开发与部署

基于ASP.NET AJAX的WebPart开发与部署

www.jz123.cn  2008-09-20   来源:   中国建站    袁袁整理    我要投递新闻

本文中的信息都是收集来的,来源很多,无法一一列出,望见谅。内容仅作为个人的知识管理。
Windows SharePoint Services v3 基于ASP.NET 2.0构建。Microsoft ASP.NET AJAX 1.0在MOSS之后推出,因此在某些情况下,ASP.NET AJAX 和 SharePoint之间存在一些兼容性问题,这些问题将会在Windows SharePoint Services SP1中解决。在此之前要在SharePoint中使用ASP.NET AJAX技术,需要进行一些特殊的部署步骤。
注意:

UpdatePanel在 webpart中使用会有所限制。详细情况请查考ASP.NET AJAX的文档。并不是所有的控件都可以在UpdatePanel中使用。

如果启用了输出缓存,就不能使用ASP.NET AJAX,否则会出现错误。经典的性能与时效的矛盾。

在SharePoint中使用Microsoft ASP.NET AJAX 1.0技术带来的好处:
可以形成一套完整的客户端脚本资源库,并积累一些可重用的部件。
可以使用 JSON展示我们的Web服务数据, 结果可以很容易的在JavaScript/Ajax应用程序中使用。
利用扩展中的技术构建WebPart可以提供高交互性的样式,比如一个具备自动完成功能的 textbox.
在WebPart中利用 UpdatePanel,实现无回调的交互,减少刷新页面的次数。
下面是部署使用了Microsoft ASP.NET AJAX 1.0技术的组件前的环境准备步骤。(只需在新安装的环境中部署一次,以后添加Webpart就不用了)

下载并在Web服务器场上安装ASP.NET AJAX

首先,必须安装 "ASP.NET 2.0 AJAX Extensions 1.0" ,可以从ajax.asp.net下载。
 
为Microsoft ASP.NET AJAX 1.0扩展 SharePoint web.config
我们需要为Ajax注册一些特定的条目。 编辑SharePoint的 web.config文件,该文件通常位于如下目录:


c:\inetpub\wwwroot\wss\virtualdirectories\80
  添加 <sectionGroup>元素到  <configSections>标记: <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>
添加 <controls> 节的内容,放在 <system.web>/<pages> 标记中。     <pages>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </controls>
    </pages>   
在<compilation>标记内的<assemblies> 标记中添加下面的内容:       <assemblies>
       <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </assemblies>
在 <httpHandlers> 节中添加下面的内容:  <httpHandlers>

上一篇:ASP.NET AJAX 客户端生命周期事件 下一篇:使用AjaxPro开发四级无刷新联动下拉框

评论总数:2 [ 查看全部 ] 网友评论