如何将 HTTPContext 用于 SPList
我有以下要求。
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要的是一个 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.