2

I am adding the Content Editor pro grammatically in my custom wp (into the asp.net Panel), where I am pre-loading the CEWP with some contents. But the issues is once added pro grammatically. I do not get an option to add any contents from the UI anymore. Any thoughts?

1

Is this during edit mode (i.e. edit webpart), or during regular view? if regular view, the control will just render the text, and is non editable. But tell me, why would you add the content editor webpart IN your webpart? If it is a custom webpart anyway, just create an editorpart which allows a user to fill in fields (i.e. webpart properties) during edit mode and which can be set declaratively (using xml when deploying in a feature) or in code.

  • Essentially what I want is to pre-load the existing content editor with some text. So I am creating a custom wp that will act like a wrapper to the existing content editor and add some text to it. Suggestions on a better approach? – Hna0002 Nov 4 '11 at 14:50
0

How are you adding this webpart? declaratively in CAML or programmatically in .NET?

Here is an example in .NET code of how to set some initial content when adding CEWP:-

http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/3afc6422-7402-4d34-9682-89fa69586813/

Here is an example of doing it within CAML in an onet.xml file:-

http://akurniaga.wordpress.com/2011/02/24/add-content-editor-web-part-into-site-template/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.