views:

221

answers:

1

I have the following requirement.

public void GetSubSite(SPWeb site)
{
    site.AllowUnsafeUpdates = true;

    SPList destinationList = site.Lists[TASKS];
    SPWebCollection subSitesCollection = site.Webs;
    foreach (SPWeb subSite in subSitesCollection)
    {
        //.....

Now I want to display the destinationList as a web part, and every time the user loads the page, it should be populated freshly.

How can i achieve that with HTTPContext?

A: 

What you need is a ListViewWebPart, create a Web Part Page in SharePoint and Configure it to display Task details, to show only the current user you can create a view and hook that to the webpart. You dont need to write even a single line of code. Most of the requirement will be served by the Out Of the Box options from it.

Kusek