Get textarea in codebehind
asp.net, c#, textarea
Solution
You should add `runat="server"` to your `<TextArea id="myTextArea" runat="server" />`
like this you can directly get the value in code behind just by using the ID of the textarea
And if you dont wanna use server side then you have to use Jquery to get the value and create a `[webmethod]` method in your code behind so Jquery can call that method passing the value
or simply `string data = request["codearea"];`
Problem
I am trying to get a textarea value from code behind using the following code. ``` HtmlTextArea bodytextarea = new HtmlTextArea(); bodytextarea = (HtmlTextArea)(this.FindControl("codearea")); string txtbod = bodytextarea.Value; ``` When i debug it i get a null reference exception saying that bodytextarea is null. I have to mention that my textarea is not runat="server" and i do not want to make it on server side. Any help?