Binding DSO to HTML
“Once the data has been retrieved and cached locally, we can use it to populate HTML controls in a Web page (a process called data binding), or we can work with it directly using ADO code within the page. In fact, even when using data binding, we’ll often still implement ADO code in the page. This is particularly the case when we want to update the data and submit the changes back to the server.
Data binding uses the Data Binding Agent object that is part of Internet Explorer 4 and higher. When programming in a language like Visual Basic or C++, the special controls that are part of that environment are used to implement data binding instead.
The Web-based Data Binding Agent can provide two types of data binding, either tabular data binding or single record data binding (often called current record data binding). All DSO controls can take part in tabular data binding or single/current record data binding. We’ll briefly summarize the HTML controls that are used in Web pages next, then go on to look at the two types of data binding where they can be used.
Controls that can be bound to a DSO recognize special HTML attributes that provide the connection information they need. These are:
DATASRC - the ID of the DSO that will supply the data, prefixed by a ‘#’ hash character.
DATAFLD - the name of the field in the DSO’s recordset to bind this control to.
DATAFORMATAS - Either ‘TEXT’ (the default if omitted) to display the field value as plain text, or ‘HTML’ to specify that the browser should render any HTML content within the value.”
Read the full article at ASP101.
