I am facing issue of web part(CEWP) provisioning in wiki page programmatically.
Web part added successfully in wiki page in display mode using below code:
string markup = string.Format(CultureInfo.InvariantCulture, "<div class=\"ms-rtestate-read ms-rte-wpbox\" contentEditable=\"True\" ><div class=\"ms-rtestate-read {0}\" id=\"div_{0}\"></div><div style='display:none' id=\"vid_{0}\"></div></div>", new object[] { wpStorageKey.ToString("D") });
Web part property is generated perfect as we want.
but When I am going to opening in web part in edit mode to change the property . Web part is not added in edit mode.But using Contents=1
I can see web part exists in page.
I have tried below method also. Method is very helpful for me but it is generating odd even HTML which is damn complex.
WikiEditPage.InsertWebPartIntoWikiPage(existingFile, cewp, 10);
Anyone can help me out of this!! It's really a headache.