sharepoint 中quickpart 如何部署带Ajax系列
2009-10-14 00:58
246 查看
1.安装ASPAJAXExtSetup(ASP.NET Ajax扩展)
2.安装ASPNETAJAXVS2008(VS 2008 Ajax扩展,如果是VS2005那就装2005对应的,这两个都可以在http://ajax.asp.net/下载最新版本)
3.安装Quickpart(http://www.codeplex.com/smartpart )或Smartpart(http://www.codeplex.com/quickpart )
4.修改web.config:
1). 在 <configSections>节点下添加<sectionGroup>节点
<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>
2). 为 <system.web>/<pages> 添加<controls>子节点
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
3). 将以下添加到<assemblies> 中, <assemblies>是<compilation>的子节点:
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
4). 在<httpHandlers> 下添加以下注册项:
<httpHandlers>
<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>
5). 在< HttpModules > 下添加以下注册项:
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
6). 在<SharePoint>/<SafeControls>下添加:
<SafeControls>
<SafeControl Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TypeName="*" Safe="True" />
</SafeControls>
7). 最后,将以下内容添加到web.config 文件的最底部,也就是在<configuration> 结束标记前。
<system.web.extensions>
<scripting>
<webServices>
<!-- 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>
如果你按以上步骤做完并且在Quickpart\Smartpart中可以正常使用Ajax控件,那么恭喜你!假如你像我一样尽管做完所有步骤但总是无法正常显示Ajax控件(也许是本人能力有限,忽略了什么重要步骤,如果有高手指点,不甚感激。初步估计是在web.config中配置的程序集版本或PublicKeyToken不对,因为我下载的安装程序都是最新的,而以上资料则很早就发布了。),那么请您继续往下看。
这几天在Codeplex上忽然遇到一个好东东SharePoint ASP.NET Ajax Enabler
,其实就是一个帮你配置web.config的解决方案文件,估计还有一些其它的操作,可以下载源代码研究,作者已经做了一个视频,按照视频部署好之后就可以正常使用Ajax控件了,也就是可以忽略上面的第七步。
当然你可以在UserControl中使用AJAX Control Toolkit(太酷了,不是吗?)。首先下载AJAX Control Toolkit(http://ajax.asp.net/ ),然后本人建议你将AJAXControlToolkit.dll部署到GAC中(在Visual Studio命令行工具中,先进AJAXControlToolkit.dll所在目录,然后输入:Gacutil /i AJAXControlToolkit.dll)。然后修改web.config文件。
1) 在<compilation>下的<assemblies>节点下添加:
<add assembly="AjaxControlToolkit, Version=1.0.20229.20821, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>
注意版本号和PublicKeyToken,可以在GAC目录(C:\Windows\assembly)中查看。
2) 在<pages>下的< controls>节点下添加:
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
部署完成后将AJAXControlToolkit添加到VS的工具栏中,现在你就可以尽情享受AJAX给你的超强便利了!
下面再说一下本人总结的一些小经验。首先如果要在Quickpart中使用AJAX的话,你必须在母版页中手动添加ScriptManager,方法就不细讲了,因为本人发现了一个更加简单便利的方法。你可以先在页面中添加一个SmartPart with AJAX(注意要在第一个添加!否则会出错。),然后就可以在Quickpart中使用含AJAX控件的UserControl了,原理也很简单,SmartPart已经帮我们添加了一个ScriptManager。
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/yzrwhx_love/archive/2009/01/09/3743041.aspx
2.安装ASPNETAJAXVS2008(VS 2008 Ajax扩展,如果是VS2005那就装2005对应的,这两个都可以在http://ajax.asp.net/下载最新版本)
3.安装Quickpart(http://www.codeplex.com/smartpart )或Smartpart(http://www.codeplex.com/quickpart )
4.修改web.config:
1). 在 <configSections>节点下添加<sectionGroup>节点
<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>
2). 为 <system.web>/<pages> 添加<controls>子节点
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
3). 将以下添加到<assemblies> 中, <assemblies>是<compilation>的子节点:
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
4). 在<httpHandlers> 下添加以下注册项:
<httpHandlers>
<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>
5). 在< HttpModules > 下添加以下注册项:
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
6). 在<SharePoint>/<SafeControls>下添加:
<SafeControls>
<SafeControl Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TypeName="*" Safe="True" />
</SafeControls>
7). 最后,将以下内容添加到web.config 文件的最底部,也就是在<configuration> 结束标记前。
<system.web.extensions>
<scripting>
<webServices>
<!-- 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>
如果你按以上步骤做完并且在Quickpart\Smartpart中可以正常使用Ajax控件,那么恭喜你!假如你像我一样尽管做完所有步骤但总是无法正常显示Ajax控件(也许是本人能力有限,忽略了什么重要步骤,如果有高手指点,不甚感激。初步估计是在web.config中配置的程序集版本或PublicKeyToken不对,因为我下载的安装程序都是最新的,而以上资料则很早就发布了。),那么请您继续往下看。
这几天在Codeplex上忽然遇到一个好东东SharePoint ASP.NET Ajax Enabler
,其实就是一个帮你配置web.config的解决方案文件,估计还有一些其它的操作,可以下载源代码研究,作者已经做了一个视频,按照视频部署好之后就可以正常使用Ajax控件了,也就是可以忽略上面的第七步。
当然你可以在UserControl中使用AJAX Control Toolkit(太酷了,不是吗?)。首先下载AJAX Control Toolkit(http://ajax.asp.net/ ),然后本人建议你将AJAXControlToolkit.dll部署到GAC中(在Visual Studio命令行工具中,先进AJAXControlToolkit.dll所在目录,然后输入:Gacutil /i AJAXControlToolkit.dll)。然后修改web.config文件。
1) 在<compilation>下的<assemblies>节点下添加:
<add assembly="AjaxControlToolkit, Version=1.0.20229.20821, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>
注意版本号和PublicKeyToken,可以在GAC目录(C:\Windows\assembly)中查看。
2) 在<pages>下的< controls>节点下添加:
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
部署完成后将AJAXControlToolkit添加到VS的工具栏中,现在你就可以尽情享受AJAX给你的超强便利了!
下面再说一下本人总结的一些小经验。首先如果要在Quickpart中使用AJAX的话,你必须在母版页中手动添加ScriptManager,方法就不细讲了,因为本人发现了一个更加简单便利的方法。你可以先在页面中添加一个SmartPart with AJAX(注意要在第一个添加!否则会出错。),然后就可以在Quickpart中使用含AJAX控件的UserControl了,原理也很简单,SmartPart已经帮我们添加了一个ScriptManager。
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/yzrwhx_love/archive/2009/01/09/3743041.aspx
相关文章推荐
- sharepoint 2016 学习系列篇(2)-如何部署sharepoint server 2016(1)-AD域服务器安装和部署
- sharepoint 2016 学习系列篇(3)-如何部署sharepoint server 2016(2)-数据库服务器安装和部署
- sharepoint 2016 学习系列篇(4)-如何部署sharepoint server 2016(3)-Sharepoint服务器安装和部署
- SharePoint【调试,诊错系列】-- 如何在Windows 2008中部署dll到GAC
- [转]轻松掌握Ajax.net系列教程二:部署Ajax Control Toolkit
- 如何查看部署到SHAREPOINT 中的DLL的PublicKeyToken值
- 轻松掌握Ajax.net系列教程二:部署Ajax Control Toolkit
- 如何卸载自己部署在sharepoint中的工作流
- 如何通过PowerShell 部署Feature(SharePoint 2013)
- 轻松掌握Ajax.net系列教程二:部署Ajax Control Toolkit
- 如何在SharePoint下创建支持Ajax的WebPart
- 轻松掌握Ajax.net系列教程一:部署AJAX.NET(转)
- 企业内部IT一体化系列之三:WEB平台 SharePoint部署
- SharePoint【ECMAScript对象模型系列】-- 03. 如何查看SP object的所有方法(method)
- 轻松掌握Ajax.net系列教程一:部署AJAX.NET
- SharePoint【Ribbon系列】-- 09.如何让用户定义的Ribbon引用外部Javascript文件
- SharePoint【调试,诊错系列】-- 如何让Sharepoint2010网站返回详细错误信息
- sharepoint 2016 学习系列篇(8)-如何修改网站标题以及Logo
- 【TX1学习与开发系列】(四)如何快速部署多个tx1系统(USB版)
- 轻松掌握Ajax.net系列教程二:部署Ajax Control Toolkit