How to Use ajax and ajaxtoolkit in sharepoint?

Source: Internet
Author: User

How to Use ajax and ajaxtoolkit in sharepoint? Favorites
How can I use ajax and ajaxtoolkit in sharepoint? I used to go to Baidu and Google multiple times! Basically, it is about modifying the configuration files under the site! Hey, of course, I also modify the configuration file here!

The following is my question on msdn! Follow the steps described by Microsoft engineers

Http://social.microsoft.com/Forums/zh-CN/partnercndevsharepoint/thread/2d63d004-ef0c-4bad-88e9-c40992e136b8

Reference his reply:

The most official guide on how to configure ASP. net ajax in Sharepoint is:
Integrating ASP. net ajax with SharePoint
Http://sharepoint.microsoft.com/blogs/mike/Lists/Posts/Post.aspx? ID = 3
This article describes how to install and configure ASP. net ajax 1.0 Extensions.

1. First install ASP. net ajax 1.0 Extensions and put AjaxControlToolkit. dll in the gac global cache.

2. Modify the web. config file under the site! In http://c1dv2q.blu.livefilestore.com/y1pvl_gf_tuoLPA622YoLz28DnS9x7Ppd81axdMZ2Xti3fmzell0pOQmW5Ybr8B5M01Hsw6G-miTrjtyVts-pAjhAnBnR6lr1Aj/web.config? Download web. config overwrite your web. config and write the node notes to be added using ajax! Add those nodes to your web. config if they are not overwritten.

3. Copy AjaxControlToolkit. dll to the bin directory under your site, for example, C: \ inetpub \ wwwroot \ wss \ VirtualDirectories \ 9000 \ bin.

4. Write the test code!

<% @ Control Language = "C #" AutoEventWireup = "true" CodeBehind = "ajaxTest. ascx. cs" Inherits = "Sample. ajaxTest" %>
<% @ Register Assembly = "AjaxControlToolkit, Version = 3.0.20842516598, Culture = neutral, PublicKeyToken = 28f01b0e84b6d53e"
Namespace = "AjaxControlToolkit" TagPrefix = "cc2" %>

<Asp: UpdatePanel ID = "UpdatePanel1" runat = "server">
<ContentTemplate>
<Asp: TextBox runat = "server" ID = "tbInput"/>
<Asp: Button ID = "btnTest" runat = "server" Text = "test Ajax" onclick = "btnTest_Click"/> <br/>
<Asp: Label ID = "lblShow" runat = "server"/>
<Br/>
</ContentTemplate>
</Asp: UpdatePanel>
<Cc2: TabContainer ID = "TabContainer1" runat = "server" ActiveTabIndex = "0"
Onactivetabchanged = "TabContainer1_ActiveTabChanged"
Ondatabinding = "TabContainer1_DataBinding">
<Cc2: TabPanel ID = "TabPanel1" runat = "server" HeaderText = "news">
<HeaderTemplate> international news </HeaderTemplate>
<ContentTemplate>
<Table>
<Tr> <td> sina </td> </tr>
<Tr> <td> sohu </td> </tr>
<Tr> <td> 163 </td> <td> Netease </td> </tr>
</Table>
</ContentTemplate>
</Cc2: TabPanel>

<Cc2: TabPanel ID = "TabPanel2" runat = "server" HeaderText = "blog">

</Cc2: TabPanel>

<Cc2: TabPanel ID = "TabPanel3" runat = "server" HeaderText = "Forum">
</Cc2: TabPanel>

<Cc2: TabPanel ID = "TabPanel4" runat = "server" HeaderText = "friends">
</Cc2: TabPanel>
</Cc2: TabContainer>

<Asp: SiteMapPath ID = "SiteMapPath1" runat = "server">
</Asp: SiteMapPath>
Save it as a. ascx file and place it under the C: \ Program Files \ Common Files \ microsoft shared \ Web Server Extensions \ 12 \ TEMPLATE \ CONTROLTEMPLATES directory!

5. Open your port website with sharepoint designer

Create a sharpointUseAjaxTest. aspx page in the Pages folder!

Copy the following code:

<% @ Page Language = "C #" %>
<Html dir = "ltr" xmlns: mso = "urn: schemas-microsoft-com: office" xmlns: msdt = "uuid: C2F41010-65B3-11d1-A29F-00AA00C14882">
<% @ Register src = "~ /_ Controltemplates/ajaxTest2.ascx "tagname =" ajaxTest2 "tagprefix =" uc2 "%>
<% @ Register src = "~ /_ Controltemplates/ajaxTest. ascx "tagname =" ajaxTest "tagprefix =" uc1 "%>
<Head runat = "server">
<META name = "WebPartPageExpansion" content = "full">
<! -- [If gte mso 9]> <xml>
<Mso: CustomDocumentProperties>
<Mso: PublishingContactPicture msdt: dt = "string">, </mso: PublishingContactPicture> <mso: PublishingContact msdt: dt = "string"> </mso: publishingContact> </mso: CustomDocumentProperties> </xml> <! [Endif] -->
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
<Title> This is sharepoint use AJAX test </title>
</Head>

<Body>
<Form id = "form1" runat = "server">

<Asp: ScriptManager ID = "ScriptManager1" runat = "server"> </asp: ScriptManager>
<Uc2: ajaxTest2 ID = "ajaxTest2" runat = "server"/>
<Uc1: ajaxTest ID = "ajaxTest1" runat = "server"/>
</Form>
</Body>

</Html>
Save and check in. Right-click "preview in the browser" to see the effect!

Note that the address is http: // server: port/_ layouts/sharpointUseAjaxTest. aspx.

The style I put him in sharepoint is different from that in! If anyone knows how to solve the style conflict, please tell me! Thank you!

 

 

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.