I cannot get this to work, here is code that I found in another thread but it is not working for me, I'm getting "set_content is not a function" :
$find("<%=Hee.ClientID%>").set_content("whatever");
Is this still valid?
I also tried to set value of the textbox it extends, tried setting InnerHtml of both,none worked.
$find("<%= Hee.ClientID %>")._editableDiv.innerHTML = "whatever";
I was going nuts for hours looking for a way to change the content and here's what I've come up with that works quite well:
This is the 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>
This works like a charm. The above element ID is actually that of a div, however changing its contents updates the replyBody.Text
property
Try this:
$("#<%=Hee.ClientID%>").html("whatever");
You could try this out:
var ctrl = $get("<%=Hee.ClientID%>").control;
ctrl.set_content("whatever");