SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am adding the Content Editor pro grammatically in my custom wp (into the 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?

share|improve this question

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.

share|improve this answer
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

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:-

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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