如何在FCK编辑器中获取值?

时间:2012-08-02 14:14:48

标签: c# asp.net sql fckeditor

我的FCK编辑器有问题。我想在Fck编辑器中获取一个值,编辑器在窗体视图中,我无法使用 Find Control 来访问它。你可能会问老兄为什么要在Fck获得价值?因为我正在尝试编写更新代码,而我的一个字段必须有FCK编辑器。

我的意思是我可以使用 Find Control 来覆盖我在FormView中的文本框;

TextBox txt_my_text =(TextBox)FormView1.FindControl(“TextBox1”);

然后我可以使用它的值,如cmd.Parametres.Add(“@ param”,txt_my_text.Text);

但我希望达到Fck Editors的价值,请帮助。

1 个答案:

答案 0 :(得分:0)

您可以像使用任何其他服务器控件(从文本框一样)执行此操作。

FckEditor editor = new FckEditor(); //You need to create a new instance of the editor
var abcd = editor.Value; 

您要做的是创建FckEditor类的新实例。

也可能最好用HtmlEncode值:

var abcd = server.Htmlencode( editor.Value;)