开发者

Sharepoint 2010 Built-In Web Service - How to Delete File and/or Folder

开发者 https://www.devze.com 2023-01-28 13:14 出处:网络
Is there a built-in SP 2010 web service for deleting a file/folder in a doc libra开发者_Go百科ry?Use the WCF data services.They are really easy to work with.Here is an example of pulling data using th

Is there a built-in SP 2010 web service for deleting a file/folder in a doc libra开发者_Go百科ry?


Use the WCF data services. They are really easy to work with. Here is an example of pulling data using the service and displaying it in a div container with a little help from jQuery.

<div id="communityinvolvement-stories"></div>
<script type="text/javascript">
    $.getJSON("/communityinvolvement/_vti_bin/listdata.svc/Pages?$filter=(ContentType ne 'Welcome Page')", function (data) {        
            var count = 0;
            $.each(data.d.results, function(i,result) {
                var title = result.Title;
                var comments = result.Comments ? "<br /><span class='alt'>" + result.Comments + "</span>" : "";
                var href = result.Path + "/" + result.Name;

                html = "<a class='summary-link' href='" + href + "'><p><h6>" + title + comments + "</h6></p></a>";

                $('#communityinvolvement-stories').append($(html));
            });         
         });        
    </script>


Another (non web-service) client option is I found is to use the Sharepoint 2010 Client Object Model approach. See links for details.

http://msdn.microsoft.com/en-us/library/ee857094.aspx#SP2010ClientOM_Deleting_Client_Objects

http://ranaictiu-technicalblog.blogspot.com/2010/03/sharepoint-2010-manage.html

0

精彩评论

暂无评论...
验证码 换一张
取 消