简体   繁体   English

以编程方式将任务添加到sharepoint中的taskList中

[英]Adding Tasks programmatically into the taskList in sharepoint

I have Task List on URL, what I want , when the page loads, the Task list should be loaded with all the aggregated tasks of its sub sites. 我在URL上有“任务列表”,这是我想要的,当页面加载时,“任务列表”应随其子站点的所有聚合任务一起加载。

I want to do it in C# 我想用C#来做

You may not need to develop this yourself as there are out-of-the-box solutions available. 您可能不需要自己开发此功能,因为有现成的解决方案可用。

Out-of-the-box 盒子外面

If you have Office SharePoint Server 2007 (not just WSS 3.0) just add the Content Query Web Part do the page where you'd like to add the aggregated data. 如果您具有Office SharePoint Server 2007(而不仅仅是WSS 3.0),则只需添加内容查询Web部件,然后在要添加聚合数据的页面上进行即可。 Then configure it to display items from the Task list only. 然后将其配置为仅显示“任务”列表中的项目。

Another option which works if you have WSS 3.0 as well is SharePoint Designer. 如果您也有WSS 3.0,另一个可行的选择是SharePoint Designer。 You can add the data view web part to the page and configure it to do the same, although only from a fixed set of sites. 您可以将数据视图Web部件添加到页面上,并将其配置为执行相同的操作,尽管只能从一组固定的站点进行。

There are also other solutions out there that you can purchase. 您还可以购买其他解决方案。

Custom 习惯

If you'd still like to go down the custom route, there are also several options. 如果您仍然想遵循自定义路线,也有几种选择。 Have a look at what they are on this SharePoint Dev Wiki page . 此SharePoint Dev Wiki页面上查看它们的内容。 Again, some of these have a requirement of Office SharePoint Server. 同样,其中一些要求Office SharePoint Server。

There is also the method of looping through the sub-sites, getting an instance to each list, and then querying that list using the techniques listed here . 还有一种方法可以遍历子站点,为每个列表获取一个实例,然后使用此处列出技术来查询该列表。 This isn't recommended if you have several sub-sites or lists containing a lot of items as it will be time consuming, tough on memory, and you will need to implement a caching solution. 如果您有多个包含大量项目的子站点或列表,则不建议这样做,因为这将很耗时,并且占用大量内存,并且您将需要实现缓存解决方案。

You can use a content query web part and scope only Task Lists of sub sites: 您可以使用内容查询Web部件并仅作用域子站点的任务列表:

http://www.novolocus.com/2008/07/18/content-roll-up-options-part-ii-content-query-web-part/ http://www.novolocus.com/2008/07/18/content-roll-up-options-part-ii-content-query-web-part/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM