How to retrieve a value in [TEXTAREA] in an aspx (add manually)

Z

zoltix

Hi,
How to retrieve a value in [TEXTAREA] in an aspx page?
Normally it is easy, drag and drops the textarea in aspx page and it is
work. But in this case, I generate the html code manually () and put as
literal html in the aspx page. How to do for retrieving the value in my
textarea without define a variable (runnat server) in c# code?

I thought this code retrieve all controls and value in all tag inside
the Form tag, it is not the case.

for(int i=0; i<Request.Form.Count;i++)
{ Response.Write(Request.Form+
"<br>"); Response.Write(Request.Form.Get(i)+
"<br>"); Response.Write(Request.Form.GetKey(i)+ "<br>");
}



Example: html
<form id="Form1" method="post" runat="server">
<TEXTAREA id="TEXTAREAcoucou" style="Z-INDEX: 101; LEFT: 559px;
POSITION: absolute; TOP: 211px" rows="2" cols="20">TEXTAREAcoucou
TEXTAREAcoucou</TEXTAREA>
</form>



Could you help me?

Bye bye
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

You have to add the control to the page in the postback, the controls
generated dynamically needs to be recreated each time the page is submitted


cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top