Hi,
Can anybody tell me how to set values to textarea.
i have an value from sqldb which are to be set.

I can retrive the values like this

string add1 = Request.Form["txtadd1"];

but not able to set the values to the textarea.

Recommended Answers

All 2 Replies

Member Avatar for stbuchok

Use a serverside control. then you can just do the following:

//HTML control with runat="server" so that it is accessible to .Net
<textarea id="txtTextArea" runat="server"></textarea>

or you can use the ASP.Net control

<asp:TextBox id="txtTextArea" TextMode="multiline" runat="server" />
//txtTextArea being the ID of the control
txtTextArea.Text = "The text you want in it";

Thanks stbuchok for reply its work fine

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.