How do I access HTML controls from the code behind?

A

aaa

I need to get a value out of a text area field. How do i reference this
field in my code behind?
 
J

Joerg Jooss

aaa said:
I need to get a value out of a text area field. How do i reference
this field in my code behind?

Create a HTML control. Just add the runat="server" attribute and
reference the control by its id attribute, like any server control.

Example:

ASPX

<input id="cancelButton" type="button" value="Cancel"
name="cancelButton" runat="server">

Code-behind class

protected System.Web.UI.HtmlControls.HtmlInputButton cancelButton;


Cheers,
 
K

karthick

OK, have the control as it is, and do the javascript on the server
side... unless it is not an confirm()....

Hth,
Karthick
 
K

karthick

OK, have the control as it is, and do the javascript on the server
side... unless it is not an confirm()....

Hth,
Karthick
 
J

Joerg Jooss

karthick said:
OK, have the control as it is, and do the javascript on the server
side... unless it is not an confirm()....

Hth,
Karthick

Your comments aren't really helpful. What is the problem?

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

Members online

No members online now.

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top