Dynamic HTML part 5

This month I've been exploring Data Binding, Internet Explorer 4.0's system for linking Web pages to the records in database files. With just a little effort you can do all sorts of things, from displaying, sorting and filtering lists to producing online image galleries - and all without any server-side programing support. Paul Stephens.


Menu1.gif (14675 bytes)Data Binding brings a bit of client-server database architecture to the Web. Instead of having to 'hard code' information, such as lists of products and events, into your web page source, you create HTML elements (DIVs, TEXTAREAS etc) to hold the data, then 'bind' the page to a database file at run time. The elemtns then receive data from the database, and display it on screen.Your users can read through the records in the database, with the screen display updated automatically every time they move to a new record. When the data changes, you just upload a new copy of the database file to your server (just like uploading a GIF image), and leave the web page document alone.

Menu2.gif (6600 bytes)Data Binding sounds fearsome, but it's really quite straightforward. You place a 'Data Source Object' (actually an ActiveX control) in your Web page source, which downloads a database file from your server (getting the file onto the server is easy - you just upload it as if it was a GIF or JPG image). You then 'bind' HTML page elements (DIVs, TEXTAREAS etc) to fields in the database record - either on an individual basis, or as part of an automatically-repeating table, in which case IE 4 expands the table to accommodate all the records in the database.

For full details of data binding - and everything else to do with IE 4.0 Dynamic HTML - it's well worth downloading Microsoft's Internet Client SDK. Click here to visit the SDK site, then choose 'download' from the left-hand menu.

Below are links to sample web pages which illustrate some of the things you can do with data binding in IE4. After viewing each page, use your browser's Back button to return to this menu. It's worth viewing these pages from here on my Web site, to see that they really do sort and filter the data without going back to the server.

Showing data records in an automatically-repeating table.

Showing one database record at a time

Setting data types - good reasons for declaring fields as numbers and dates

Interpreting database fields as HTML

Creating hyperlinks from database fields

An image gallery - using a database field as the SRC property of an image object

(Final tip - check the hyperlink (<a>) tags in the source of this page for a way of protecting IE4-only pages from access by non-IE4 browsers)