Silverlight uses Ajax to operate the Sharepoint list

Source: Internet
Author: User

In Sharepoint development, what should I do when the Silverlight APPLICATION IN THE WebPart wants to operate the list, such as adding data to a list in Sharepoint? We know that Silverlight is a browser-side application and cannot directly operate on the list in Sharepoint. It can only interact with Sharepoint through its carrier-WebPart, then, you will naturally think of using Silverlight to call the script on the page and pass parameters. The script then uses Ajax to send the data passed by Silverlight back-end code to the Webpart, this article will explore this.

First, create a Silverlight project and change its Build directory to ClientBin under the layouts directory in Sharepoint.

C: \ Program Files \ Common Files \ Microsoft Shared \ Web Server Extensions \ 14 \ TEMPLATE \ LAYOUTS \ ClientBin \

Create a WebPart project. Note that the Sharepoint site is selected when Debug and Deploy are selected.

After completing the above two steps, you can open the website and edit the page to verify that the website can be correctly deployed.

After the project is created, we try to call the Ajax operation list through Silverlight.

We need to preset a piece of code in the WebPart for Silverlight to call. Here we use the background Render to go to the foreground

Processing Ajax requests in the background Page_Load event

Then, call Silverlight in Rend.

At this point, the Silverlight program can be displayed in Sharepoint. We need to call the page script through the API in Silverlight.

Try it!

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.