Home All Groups Group Topic Archive Search About

How do I access HTML controls from the code behind?

Author
19 Apr 2005 8:31 PM
aaa
I need to get a value out of a text area field. How do i reference this
field in my code behind?

Author
19 Apr 2005 9:09 PM
Joerg Jooss
aaa wrote:

> 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,

--
http://www.joergjooss.de
mailto:news-re***@joergjooss.de
Author
20 Apr 2005 1:42 PM
aaa
that doesn't work because it now breaks my clientside javascript.


Show quoteHide quote
"Joerg Jooss" <news-re***@joergjooss.de> wrote in message
news:xn0e1777exckqe000@msnews.microsoft.com...
> aaa wrote:
>
> > 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,
>
> --
> http://www.joergjooss.de
> mailto:news-re***@joergjooss.de
Author
20 Apr 2005 3:15 PM
karthick
OK, have the control as it is, and do the javascript on the server
side... unless it is not an confirm()....

Hth,
Karthick
Author
20 Apr 2005 8:33 PM
Joerg Jooss
karthick wrote:

> 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,

--
http://www.joergjooss.de
mailto:news-re***@joergjooss.de
Author
20 Apr 2005 3:15 PM
karthick
OK, have the control as it is, and do the javascript on the server
side... unless it is not an confirm()....

Hth,
Karthick