如何将 HTTPContext 用于 SPList

发布于 2024-07-26 20:07:55 字数 400 浏览 5 评论 0原文

我有以下要求。

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

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

现在我想将 destinationList 显示为 Web 部件,并且每次用户加载页面时,都应该重新填充它。

我如何使用 HTTPContext 来实现这一点?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

何其悲哀 2024-08-02 20:07:55

您需要的是一个 ListViewWebPart,在 SharePoint 中创建一个 Web 部件页面并将其配置为显示任务详细信息,为了仅显示当前用户,您可以创建一个视图并将其挂钩到 Web 部件。 您甚至不需要编写一行代码。 大多数要求将通过其中的开箱即用选项来满足。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文