【问题标题】:Create Sharepoint 2010 Webpart page in C#在 C# 中创建 Sharepoint 2010 Webpart 页面
【发布时间】:2012-06-06 20:37:30
【问题描述】:

我想以编程方式为 Sharepoint 2010 创建一个 Webpart 页面(.aspx 文件)。我已经找到了这段代码 sn-p:

public static PublishingPage CreatePage(string fileName, string title)
  {
     PublishingWeb pWeb = PublishingWeb.GetPublishingWeb(Web);
     PageLayout[] layouts = pWeb.GetAvailablePageLayouts();
     PageLayout layout = layouts[0];
     foreach (PageLayout p in layouts)
     {

        if (p.Name.Equals("BlankWebPartPage.aspx"))
        {
           layout = p;
           break;
        }
     }
     try
     {
        PublishingPage newPage = pWeb.GetPublishingPages().Add(fileName, layout);
        newPage.Title = title;
        newPage.Update();
        return newPage;
     }
     catch (Exception)
     {
           return null;
     }
  }

但我的问题是 SharePoint Foundation Server 没有发布部分,但我必须在 SharePoint Foundation Server 上运行它。 是否可以在没有 PublishingWeb 的情况下创建 Webpart 页面?

问候

【问题讨论】:

标签: sharepoint publishing sharepointfoundation2010 webpartpage


【解决方案1】:

发布基础结构是仅在 SharePoint Server Standard 或 Enterprise 中可用的功能之一。它不包含在 SharePoint Foundation 2010 中。它也不包含在 Windows SharePoint Servives (WSS) 中。发布始终需要购买的产品版本。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-04-09
    • 1970-01-01
    • 2012-01-08
    • 1970-01-01
    • 2011-09-21
    • 1970-01-01
    • 2012-08-18
    • 2013-12-27
    相关资源
    最近更新 更多