Problem with Rendering cuteeditor component to string (as part of mvc HtmlHelper)

  •  01-14-2010, 8:57 PM

    Problem with Rendering cuteeditor component to string (as part of mvc HtmlHelper)

    Today I tried to render CuteEdit component but I've got an unexpected result with just one textarea tag.. :(

    Code, that I used:

    var q = new CuteEditor.Editor() { ID = "asdfgh" };
    q.ConfigurationPath = "/cutesoft_client/cuteEditor/configuration/autoConfigure/compact3.config";
    q.EditorWysiwygModeCss = "/Content/css/cuteeditor.css";
    q.Visible = true;

    System.Web.UI.Adapters.ControlAdapter w;
    var sb = new StringBuilder();
    var hw = new HtmlTextWriter(new System.IO.StringWriter(sb));
    q.RenderControl(hw);
    return sb.ToString();


    Traditional using:

    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
    ...
    <CE:Editor ID="Editor1" runat="server" ConfigurationPath="/cutesoft_client/cuteEditor/configuration/autoConfigure/compact3.config" EditorWysiwygModeCss="/Content/css/cuteeditor.css" />

    In last variant I've got a lot of html code on client side with iframes etc.

    How can I programmaticaly generate this component as string (for using in mvc HtmlHelper)?

    Please, help with rendering to a string.
View Complete Thread