Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  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 specifying the identifier of the data source.
The property is read/write with no default value.

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!

Back to topBack to top

© 1998 Microsoft Corporation. All rights reserved. Terms of use.

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site