Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers 2

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
add comment

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/

share|improve this answer
add comment

Your Answer

 
discard

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.