我想从后面的代码中使用下面的代码获取textarea值。在代码隐藏中获取textarea
HtmlTextArea bodytextarea = new HtmlTextArea();
bodytextarea = (HtmlTextArea)(this.FindControl("codearea"));
string txtbod = bodytextarea.Value;
当我调试它时,我得到一个空引用异常,说bodytextarea为空。我不得不提及我的textarea不是runat =“server”,我不想在服务器端进行。任何帮助?
呀:)选项不够;) – JohnnBlade 2012-07-23 09:10:24
我有'RUNAT一个TextArea = “服务器”'在我的内容页,但我想从我的主页面访问它。我在我的内容页面中有几个标签,我在主页面中调用它:'lblUser =(System.Web.UI.WebControls.Label)ContentMain.FindControl(“lblUser”);'。我如何对TextArea做同样的事情? – SearchForKnowledge 2014-09-04 14:52:36