因此,我有标准内容编辑器webpart(MSContentEditor.dwp)。我可以通过 webPart.Title (MSDN).

我找不到任何要设置内容编辑器内容的属性。

我基本上想将WebPart提供到发布页面(完成),设置其标题,因此(完成)并为其设置一些默认内容(粘在此)中。任何帮助都将受到赞赏。

有帮助吗?

解决方案

ContentEditorWebPart wp = ....

XmlDocument xDoc = new XmlDocument();
var contentRoot = xDoc.CreateElement("ContentRoot");
contentRoot.InnerText = "Your text here";
wp.Content = contentRoot

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.contenteditorwebpart.content.aspx

其他提示

干得好 :)

contenteditorwebpart.content属性

如果您看不到此属性,则可能需要将WebPart施放到ContentEditorWebPart。

许可以下: CC-BY-SA归因
scroll top