Declare EditorControl in code

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
9/19/2010 3:38:07 PM
Gravatar
Total Posts 6

Declare EditorControl in code

I'm trying to declare and add an EditorControl in the code.  I was able to get it declared and added, but I'm unable to see the control.  I have a class that inherits from the CompositeControl with a private variable for the EditorControl.

        private EditorControl ed = new EditorControl();

I then override the Init to initialize the EditorControl.

        protected override void OnInit(EventArgs e)
        {

            base.OnInit(e);

            SiteUtils.SetupEditor(this.ed);
            this.ed.WebEditor.ToolBar = ToolBar.Full;
        }

Then I add the EditorControl in the CreateChildControls method.


            this.Controls.Add(this.ed);

 

While I thought this should work when I look at the page source I find the following.

<div id="ctl00_mainContent_ctl19_ed38bdfc82dac34361a359a8a55b881779">

   </div>

 

I was expecting a whole lot more like the following

<div class="settingrow">
        <div id="ctl00_mainContent_edWelcomeMessage">
   <div><noscript><textarea name="ctl00$mainContent$editor_noscript" rows="4" cols="40" style="width: 98%; height: 200px" ></textarea></noscript><input type="hidden" id="ctl00_mainContent_edWelcomeMessageinnerEditor" name="ctl00$mainContent$edWelcomeMessageinnerEditor" value="" /><input type="hidden" id="ctl00_mainContent_edWelcomeMessageinnerEditor___Config" value="LinkBrowserURL=http://localhost:60941/Dialog/FileDialog.aspx?ed%3Dfck%26type%3Dfile&amp;BaseHref=http://localhost:60941&amp;LinkDlgHideTarget=true&amp;StylesXmlPath=http://localhost:60941/Services/EditorStyles.ashx?cb%3D9c392fcd-3f0b-42de-b028-6ef21e8cc5f5&amp;CustomConfigurationsPath=/ClientScript/mojofckconfig.js&amp;FlashBrowserURL=http://localhost:60941/Dialog/FileDialog.aspx?ed%3Dfck%26type%3Dmedia&amp;DefaultLanguage=en&amp;ImageUpload=false&amp;ImageBrowserURL=http://localhost:60941/Dialog/FileDialog.aspx?ed%3Dfck%26type%3Dimage&amp;LinkUpload=false&amp;SkinPath=/ClientScript/fckeditor266/editor/skins/default/&amp;EditorAreaCSS=http://localhost:60941/Data/Sites/1/skins/dcarter-bluespring/csshandler.ashx?skin%3Ddcarter-bluespring&amp;HtmlEncodeOutput=false&amp;AutoDetectLanguage=false&amp;LinkDlgHideAdvanced=true&amp;ForcePasteAsPlainText=false&amp;LinkBrowser=true&amp;FlashUpload=false" /><iframe id="ctl00_mainContent_edWelcomeMessageinnerEditor___Frame" src="/ClientScript/fckeditor266/editor/fckeditor.html?InstanceName=ctl00_mainContent_edWelcomeMessageinnerEditor&amp;Toolbar=Full" width="98%" height="0px" frameborder="0" scrolling="no" title='editor area'></iframe><script type="text/javascript" > var fra_ctl00_mainContent_edWelcomeMessageinnerEditor = document.getElementById('ctl00_mainContent_edWelcomeMessageinnerEditor___Frame'); fra_ctl00_mainContent_edWelcomeMessageinnerEditor.height = 200; </script></div>
  </div>
    </div>

So, can anyone help me out here?

Thanks,
Michael

9/20/2010 10:35:53 AM
Gravatar
Total Posts 18439

Re: Declare EditorControl in code

Sorry but it is probably not possible to make it work loading it dynamically like that. It probably will not wire up the javascript correctly in that scenario.

Instead of using our Editor Control which is a wrapper around a provider model that supports multiple editors, you "might" be able to use the editor from the AjaxControlToolkit in that scenario.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.