DATASRC Attribute | dataSrc Property

DHTML, HTML, & CSS

DATASRC Attribute | dataSrc Property


Sets or retrieves the source of the data for data binding.

Syntax

HTML<ELEMENT DATASRC = sID ... >
Scriptingobject.dataSrc [ = sID ]

Possible Values

sIDString that specifies the identifier of the data source.

The property is read/write with no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see dynamic propertiesInternet Link.

Remarks

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. The string must be prefixed by a hash (#) mark.

When the dataSrc property is applied to a tabular data consumer the entire data set is repeated by the consuming elements.

When the dataSrc property is applied to a TABLE, any contained single-valued consumer objects that specify a dataFld property 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.

Example

In this 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 provided by the data source.

Sample Code

<TABLE DATASRC="#customer"> 
   <TR><TD><INPUT TYPE=TEXTBOX DATAFLD="customer_name"><TD><TR>
</TABLE>

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
A, APPLET, BODY, BUTTON, DIV, FRAME, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, LABEL, MARQUEE, OBJECT, PARAM, SELECT, SPAN, TABLE, TEXTAREA

See Also

data bindingInternet Link


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.