Language References
Sets or retrieves the source of the data for data binding.
HTML |
<element DATASRC = sID ... > |
Script |
object.dataSrc [ = sID ] |
sID |
String specifying the identifier of the data source. |
The property is read/write with no default value.
Both tabular and single-valued data consumers use the dataSrc property to specify a binding. The property takes a string that corresponds to the unique identifier of a data source object ( DSO ) on the page.
When the dataSrc property is used for tabular data binding, it specifies that the entire contents of the table be repeated once for each record from the data set.
When the dataSrc property is applied to a TABLE, any contained single-valued objects for which an associated dataFld property is specified are repeated for each record in the supplied data set. To complete the binding, the binding agent interrogates the enclosing TABLE for its data source. A tabular data consumer contained within another tabular data consumer ( TABLE ) must specify an explicit dataSrc.
The property can be set at design time and at run time. At design time, use the corresponding DATASRC attribute.
In the following example, a text box is bound to the customer_name field of a data source object with an ID of customer. Because the text box is located within a data-bound TABLE, the text box is repeated to display each of the records in the data source.
<table DATASRC="#customer">
<tr>
<td><input type=TEXT DATAFLD="customer_name"></td>
</tr>
</table>