问题描述
我使用AjaxControlToolkit.HTMLEditor,我想用JavaScript或jQuery的像这样的增值给它:
I'm using AjaxControlToolkit.HTMLEditor, and I want to add value to it using javascript or jquery like this:
alert( $find("eCompose_ctl02_ctl01")); // if
$find("eCompose_ctl02_ctl01").attr('value') = "asdfasdfasdf asdfasd asdf sf";
也试过这样的:
also tried like this:
document.getElementById('eCompose_ctl02_ctl01').value += "ababsakas asdasd l";
但上面的code不插入文本HTML编辑器。谁能帮助我?谢谢...
But the above code does not insert text into HTMLEditor.Can anyone help me? thanks...
编辑这是HTML code的HTML编辑器:
EDITthis is html code for HTMLEditor:
<HTMLEditor:Editor ID="eCompose" runat="server" Height="240px" Width="90%" AutoFocus="true" InitialCleanUp="true" />
我试图访问是这样的:
i tried to access like this:
alert(document.getElementById("<%= eCompose.ClientID %>"))
和得到空
推荐答案
使用.NET提供的是Ajax的方法来做到这一点:$找到(NAME_OF_THE_CONTROL)set_content(世界,你好)。
The way to do it using the Ajax methods that .NET provides is:$find("NAME_OF_THE_CONTROL").set_content("Hello world");
NAME_OF_THE_CONTROL是你控制的客户端ID,我想在这种情况下,eCompose_ctl02_ctl01。
NAME_OF_THE_CONTROL is the ClientID of your control, I suppose in this case, eCompose_ctl02_ctl01.
这篇关于插入值,使用JavaScript来AjaxControlToolkit.HTMLEditor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!