Tuesday, February 7, 2012

How to Access HTML Controls from code behind


HTML element should be treated as a server control by adding

The runat="server" attribute.


For example
aspx.

<input id="test" runat="server" type="text" />

aspx.cs

string test= test.value

No comments:

Post a Comment