HTML Editor problem CMS 5

Daniel Pålsson
Member since: 2008

Have added the EPiServer Editor to a page and it works great.

Now I want to fill it with content when a you select a value from adropdownlist and click a button, but I can't get it to work.

Does anybody now how?

#29772 May 13, 2009 11:11
  • Maras M
    Member since: 2007

    Hi Daniel,

    I've already answered for your question on my blog ( )

    What you need to do is to set Text property of one of the child controls of the editor:

       protected override void OnInit(EventArgs e)
          if (!Page.ClientScript.IsClientScriptIncludeRegistered("system.js"))
                ((PageBase) Page).ResolveUrlFromUI("javascript/system.js"));
                ((PageBase) Page).ResolveUrlFromUI("javascript/system.aspx"));
                ((PageBase) Page).ResolveUrlFromUtil(
        myHtmlEditor.InnerProperty = new PropertyLongString {EditorToolOptions = EditorToolOption.All};
        protected void btnFill_Click(object sender, EventArgs e)
           ((HtmlEditor) myHtmlEditor.Controls[0].Controls[0]).Text = ddlOptions.SelectedValue;
        protected void btnSend_Click(object sender, EventArgs e)
           litMessage.Text = myHtmlEditor.PropertyValue as string;
           pnlMessage.Visible = true;

    Here is the fully functional source code for what you need:

    #29774 Edited, May 13, 2009 12:26
  • Daniel Pålsson
    Member since: 2008
    Thanks, that worked perfectly Laughing
    #29775 May 13, 2009 12:50