如何以编程方式将内容添加到内容编辑器WebPart?
-
16-10-2019 - |
题
因此,我有标准内容编辑器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
其他提示