Try our conversational search powered by Generative AI!

HTML Editor problem CMS 5


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?

May 13, 2009 11:11

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:

Edited, May 13, 2009 12:26
Thanks, that worked perfectly Laughing
May 13, 2009 12:50
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.