Use SharePoint Web Service (3): delete a sub-site

Source: Internet
Author: User

This log shows how to use web sevice to create a subsite. Now that you can create a site, you must be able to delete it. This articleArticleThis section describes how to delete a site during client programming.

Meetings. CREATEWORKSPACE provides a method to create a sub-site. The meetings. deleteworkspace method also provides a method to delete the site, but only the Meeting Workspace site can be deleted. If you try to delete a non-Meeting Workspace site, an exception will be thrown, which is clearly written in the SDK, and I will not go into details.

 

There is only one way to do this. Use SharePoint RPC, where the remove service method can do this. The following is an example:

Here, SERVICE_NAME is the relative path relative to the root site. For example, your site is Region.

 

 var rpcstring = 'method = remove + Service & SERVICE_NAME = '+ web_server_relative_url +'/'+ sitename; $. ajax ({URL: web_server_relative_url + '/_ vti_bin/_ vti_adm/admin. dll ', type: 'post', beforesend: function (xhr) {xhr. setRequestHeader ('x-Vermeer-content-type', 'application/X-WWW-form-urlencoded');}, data: rpcstring, async: True, contenttype: 'application/X-WWW-form-urlencoded ', complete: function (data, textstatus) {If (textstatus = 'success' & $ (data. responsetext ). length = 2) {// sucessfully deleted web. // do your job here} else {// failed to delete Web }}); 

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.