asp.net.ph

Skip Navigation Links

DATAFLD Attribute | dataFld Property

Language References


Sets or retrieves which field of a given data source ( as specified by the dataSrc property ) to bind to the given object.

Syntax

HTML <element DATAFLD = sField ... >
Script object.dataFld [ = sField ]

Possible Values

sField String specifying the field name.

The property is read/write with no default value.

Remarks

The property can be set at design time and at run time. At design time, use the DATAFLD attribute.

Example

In the following example, a text box is bound to the flavor field supplied by a data source object with an ID of ice_cream. Because the text box is contained within a table, the text box is repeated and all values in the flavor column are displayed.

<table DATAsrc="#ice_cream">
<tr>
  <td><input type=TEXT DATAFLD=flavor></td></tr>
</table>

In the following example the SELECT object is bound to the card_type column of a data source control with an ID of order. The value of the field in the data set determines the option that is initially selected. In addition, when the user selects a different option from the SELECT, the value of the card_type field in the current record of the data set is updated.

<select DATAsrc="#order" DATAFLD="card_type">
   <option>Visa
 <option>Mastercard
 <option>American Express
 <option>Diner's Club
 <option>Discover
</select>

Need a break ?
Suggested Reading

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph.

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