Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Sets or retrieves the source of the data for data binding.
Syntax
HTML <ELEMENT DATASRC = sID ... > Scripting object.dataSrc [ = sID ]
Possible Values
The property is read/write with no default value.
sID String specifying the identifier of the data source.
Remarks
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.
Example
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.
Sample Code
<TABLE DATASRC="#customer"> <TR><TD><INPUT TYPE=TEXTBOX DATAFLD="customer_name"><TD><TR> </TABLE>
Applies To
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.