Tutorial :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.

I want to do it in C#


You may not need to develop this yourself as there are out-of-the-box solutions available.


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. 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. 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.

There are also other solutions out there that you can purchase.


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. Again, some of these have a requirement of 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:


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »