2011-03-01 54 views
4

这里是链接,您的网页浏览将定位:http://thocong.net/dang-tin.html设定值nicedit - 它使用的textarea作为一个实例


我开发一个应用程序,它会自动邮政新闻。 当设置值来控制网页时,所有控件都可以,但我不能将值设置为编辑器(NicEdit)。该编辑器使用TextArea标签作为实例。我已经设置了textarea的值,但是当新闻发布时,我找不到设置到这个textarea的内容。 所以,请帮我解决这个问题。

下面是我使用的设置值,以控制网页上(以上链接)

HtmlDocument document = webBrowser.Document; 
HtmlElement description = document.GetElementById("content");//id of textarea 
description .SetAttribute("value", info.Content); 

码 - >>摘要:请告诉我如何设置值,以漂亮的编辑器?

回答

0

我想你会在这里找到你需要的:http://pastebin.com/sj8QA4xx - 它展示了如何使用nicEditor的API在当前光标位置插入文本。我正在成功使用它来以编程方式修改nicEditor的内容。祝你好运!

10

我知道这是一个非常古老的问题,但如果你还没有找到答案在这里,它是:

nicEditors.findEditor("your-textarea-id").setContent('some value'); 
+1

@anubhava它说当我打电话jquery.ready * setContent *不确定的() – Volatil3 2013-05-19 07:19:16

+0

请确保nicEdit的JS文件已包含在内。 – anubhava 2013-05-19 13:21:44

+0

我的所有包括,仍然setContent未定义。 – 2017-08-15 00:53:50

相关问题