asp.net.ph

HtmlInputControl.Value Property

System.Web.UI.HtmlControls Namespace   HtmlInputControl Class


Sets or retrieves the value associated with the HtmlInputControl.

Syntax


Inline <input value = strValue ... >
Script HtmlInputControl.Value [ = strValue ]

Property Value


strValue String specifying the value associated with the HtmlInputControl.

The property is read/write with a default value that depends on the type of control.

Remarks

Use this property to specify or determine the value associated with the HtmlInputControl.

Value depends on the type of control.

All other input controls have no default value.

To be submitted with the data associated with a <form>, each of the form input controls must be assigned a Name and have a valid Value. Only controls with a valid name/value pair are sent with the HTTP Request message to the receiving program for processing.

These name/value pairs are then accessible on the server via the Request.Params, Request.Form, or Request.QueryString collections.

Example

The below code shows how to declaratively set the values associated with HtmlInputRadioButton controls at design time, and how these values are used by a submit handler at run time.

<p>Choose what suits you: <br>
   <input type=radio id="cool" runat=server
      value="background:navy; color:lime">Cool
   <input type=radio id="soso" runat=server
      value="background:gainsboro; color:dimgray">So-So
   <input type=radio id="warm" runat=server
      value="background:maroon; color:gold">Warm

 Show me 

This example retrieves the values of input controls submitted with a form using POST, by looping thru the Request.Form collection.

 Show me 

This example retrieves the values of input controls submitted with a form using GET, by looping thru the Request.QueryString collection.

 Show me 

See Also

HtmlInputControl Members   Name Skip Navigation Links


Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note