1

我在我的asp页面中使用nicedit。我正在使用 asp.net 开发一个网站。我设法让nicedit工作,但我怎样才能获得textarea的值,我想在单击提交按钮时将值存储在数据库中。实际上,我正在尝试在服务器端代码(c#)中获取 textarea 值。

<script type="text/javascript" src="js/nicEdit.js"></script> 
<script type="text/javascript">
   //<![CDATA[
    bkLib.onDomLoaded(function () {
        try {
            new nicEditor({ fullPanel: true }).panelInstance('bee');
        }
        catch (ex)
      { }
    });
   //]]> 
</script> 

 <textarea id="bee" runat="server"></textarea>
4

2 回答 2

1

要获取输入数据的结果,您需要传递 textarea 的 ID。见下文:

data = new nicEditors.findEditor('bee'); // bee is the ID of the textarea
d = data.getContent(); // return the content
于 2012-04-17T04:19:01.410 回答
0

You can get the value of the textarea by the Value property

string val = bee.Value
于 2012-04-18T02:56:51.947 回答