How to deploy quickpart with Ajax in sharepoint

Source: Internet
Author: User

1. Install ASPAJAXExtSetup (ASP. NET Ajax extension)

2. Install ASPNETAJAXVS2008 (for the VS 2008 Ajax extension, if it is VS2005, install 2005. Both of them can download the latest version at http://ajax.asp.net)

3. Install Quickpart (http://www.codeplex.com/smartpart) or Smartpart (http://www.codeplex.com/quickpart)

4. modify web. config:

1) Add the <sectionGroup> node under the <configSections> node

<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) Add a <controls> subnode for <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>

 

3) add the following to <assemblies>. <assemblies> is a subnode of <compilation>:

 

<Assemblies>

<Add assembly = "System. Web. Extensions, Version = 1.0.61025.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35"/>

</Assemblies>

 

4) Add the following registration items under

 

<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) Add the following registration items under <HttpModules>:

<HttpModules>

<Add name = "ScriptModule" type = "System. Web. Handlers. ScriptModule, System. Web. Extensions, Version = 1.0.61025.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35"/>

</HttpModules>

 

 

6) Add the following content under <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) Finally, add the following content to the bottom of the web. config file, that is, before the <configuration> end mark.

 

<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>

If you have completed the preceding steps and can normally use the Ajax control in Quickpart \ Smartpart, congratulations! If you have finished all the steps just like me, you will not be able to display the Ajax control normally (maybe I have limited capabilities and ignored any important steps. If you have a high finger, I am not very grateful. It is preliminarily estimated that the Assembly version or PublicKeyToken configured in web. config is incorrect, because the installer I downloaded is up-to-date, and the above information has been released very early .), So proceed.

These days, on Codeplex, I suddenly met a good plug-in SharePoint ASP. NET Ajax Enabler.

Is to help you configure the web. in the config solution file, it is estimated that there are some other operations, you can download the source code research, the author has made a video, after the video is deployed, you can use the Ajax control normally, that is, you can ignore Step 7 above.

Of course, you can use AJAX Control Toolkit in UserControl (cool, isn't it ?). First download AJAX Control Toolkit (http://ajax.asp.net/), and then I suggest you set the AJAXControlToolkit. dll is deployed in GAC (in Visual Studio command line tool, AJAXControlToolkit is advanced. dll Directory, and enter: Gacutil/I AJAXControlToolkit. dll ). Modify the web. config file.

1) Add:

<Add assembly = "AjaxControlToolkit, Version = 1.0.20229.20821, Culture = neutral, PublicKeyToken = 28f01b0e84b6d53e"/>

Note the version number and PublicKeyToken, which can be viewed in the GAC directory (C: \ Windows \ assembly.

2) Add:

<Add namespace = "AjaxControlToolkit" assembly = "AjaxControlToolkit" tagPrefix = "ajaxToolkit"/>

After the deployment is complete, add the AJAXControlToolkit to the vs toolbar. Now you can enjoy the great convenience that AJAX gives you!

I will talk about some small experiences I have summarized below. First, if you want to use AJAX in Quickpart, you must manually add ScriptManager to the master page. The method will not be detailed, Because I have found a simpler and more convenient method. You can add a SmartPart with AJAX on the page first! Otherwise, an error occurs .), Then you can use UserControl with AJAX control in Quickpart. The principle is also very simple. SmartPart has added a ScriptManager for us.

 

This article from the CSDN blog, reproduced please indicate the source: http://blog.csdn.net/yzrwhx_love/archive/2009/01/09/3743041.aspx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.