How to install HTMLEditorExtender HTML from client side

I can't get this to work, here is the code I found on another thread, but it doesn't work for me, I get "set_content is not a function":

$find("<%=Hee.ClientID%>").set_content("whatever");

      

Is it still relevant? I also tried setting the value of the textbox it expands, tried setting the InnerHtml of both, neither worked.

+3


source to share


4 answers


$find("<%= Hee.ClientID %>")._editableDiv.innerHTML = "whatever";

      



0


source


I spent hours looking for ways to change the content, and here's what I came up with works really well:

They are TextBox and Extender:

<asp:Textbox ID="replyBody" Height="450px" Width="892px" runat="server" TextMode ="MultiLine"  />
<ajaxToolkit:HtmlEditorExtender ID="replyBody_HtmlEditorExtender" runat="server" Enabled="True" EnableSanitization="false" TargetControlID="replyBody">
</ajaxToolkit:HtmlEditorExtender> 

      



Now this is the javascript that changed the value:

<script type = "text/javascript" >
    function changeText(someString){
        document.getElementById('ctl00_ContentPlaceHolder1_replyBody_HtmlEditorExtender_ExtenderContentEditable').innerHTML = someString; 
    }
</script>

      

It works like a charm. The id of the above element is actually the id of the div, however changing its content updates the propertyreplyBody.Text

+2


source


Try the following:

$("#<%=Hee.ClientID%>").html("whatever");

      

0


source


You may try:

var ctrl = $get("<%=Hee.ClientID%>").control;
ctrl.set_content("whatever");

      

0


source







All Articles