Create Content Editor web part programmaticaly

12/03/2014 15:37

ContentEditorWebPart webpart = new ContentEditorWebPart();
            webpart.Title = "Your title";
            XmlDocument xmlDoc = new XmlDocument();
            XmlElement xmlElement = xmlDoc.CreateElement("Root");
            xmlElement.InnerText = @"<ul>
                                        <li> Your list item....
         
                                            </ul>
                                        </li>
                                    </ul>";
 
            webpart.Content = xmlElement;