【Abstract】 TDC is a component provided by Internet Explorer 4.0 and above. It is dynamically controlled to data in the local machine with a buffer mechanism in Internet Explorer 4.0 and above. If the TDC data is bound to the HTML element of the web page, you can do not rely on server-side processing logic, CGI and other server-side processing logic, implement the dynamic interaction of the user and the page, reduce the dependence of the server on the server, reduce the server's pressure and mitigate the network crowding .
[Keyword] data binding TDC dynamic page
Dynamic webpage generally implemented through the user's interaction operation, the user issues a request to the server, the server uses the information submitted by the server using ASP, CGI, etc., and returns the result to the user after processing, and this way requires the server to provide the server And the authority of the server execute program, and the other side is very dependent on the server, which will increase the burden of the server and the degree of network crowding. Internet Explorer 4.0 and later can access a qualifier text file with data binding and table data control TDC (Tabular Data Control), display data as template with HTML files, and buffered to locally The text file operation, which implements the dynamic interaction of the client and the data driver page.
One. Data binding technology
Data Binding is consisting of four parts-component-data source objects, Data Consumer, Binding Agents, and list (display) agents. Data source object provides data transfer, operation, and ability to access data through script; data references generally refer to web page elements, it defines how data is displayed; binding agent is used for data identification and maintenance; list (display) agent for guarantee list The correct reference of the data.
two. TDC components
TDC is the built-in data source control provided by Internet Explorer, providing access to the ability to deliver a delimiter text file, with properties such as Datasrc, FieldDelim, TextQuqlifier, RowDelim, Sort, Filter, and UseHeader, and the ID of the TDC object. RecordSet. {Properties | Method}, access to the properties and methods of the corresponding Recordset set.
Delicious text file
Table is generally related to the database, and a line in a delimiter text file is equivalent to a record of the database, and the string from the desired in each row is equivalent to the fields in the record. There are three delimiters in the text file referenced by the TDC: text qualifiers, field qualifiers, and row qualifiers. Suppose text files Software.txt is as follows:
Name, Description, Type, Company, LOCATION
'IE5.0', 'Microsoft Internet Explorer 5.0', 'Browser', 'Microsoft', 'TIE50.ZIP'
'Fp98', 'Microsoft FrontPage 98', 'Editor', 'Microsoft', 'FP98.ZIP'
The first behavior field name, second, three behavior two records. Wherein, single quotes (') are text qualifiers, comma (,) is field qualifiers.
Quote TDC components in the web page
Establish an instance of TDC objects with
>
Object>
Where the ID specifies a name to specify a name in order to reference, parameter textqualifer definition text qualifiers, parameter fielddelim definition field qualifiers, parameter data, specify TDC read data text file, parameter USEHEADER's TURE and FALSE specified Does a field name definition in a text file.
Bind the data to the Table element
Table is an HTML element that can make a multi-value bound,
Name TD> | software introduction td>
...... | Download Address TD>
TR> |
span> td> | span> td>
...... | Download td>
TR> In the above statement, the DataSRC, DataFLD, and DataFormats, DataPagesiae properties of the data reference components are utilized, and the data content of the text file is bound to the HRML element via the ID attribute, and the TDC control will automatically display the data content that meets the requirements in the page. three. Data Sort, Filter, Reset, and Recordset Set Data Sort by setting the sorting condition and use the RESET method, in order of order or descending order, " " in front of the field is arranged in ascending order, "-" is arranged in descending order. Filtering a subset of all records through the Reset method through a query condition, and the data displayed in the table is within the subset range. Such as: Software.sort = " name" Software.reset Single-sede parameters to the entire record according to field Name Software.sort = " Type, -company" Software.reset Several sequencing of field Type and COMPANY descending order. Software.filter = "type = browser" Software.Reset Generate a subset that contains only a browser. Software.Filter = "Type <> Browser & Company = Microsoft" Software.reset Generate the subset of the SingleSer is not a browser (Browser) and the company's entire recordset of Microsoft. Recordset property The Recordset has the following properties and methods: Recordset. {MoveFirst | MoveLast | MOVENEXT | MOVEPREVIOS} The mobile record pointer refers to the first, last one, the next, the last record. Recordset. {AbsolutionPage | PageCount | Pagesize} Returns the current page number, the total number of pages, records per page. Recordset. {recordcount | AbsolutePosition} Returns a recordset to record the number, the current record number. RECORDSET. {EOF | BOF} Return to whether it has arrived, the first record. In the web page, use the DatasRCID.Recordset. {Properties | Method} to operate the entire recordset. Such as: Software.recordset.movenext You can move the record in the above example points down one record. four. A interactive page instance for software queries In this example, the user can select the segment field by two drop-down vegetables, and filter the entire database according to a certain software name.
> Object> HEAD> sort by: b> Select> filter by: b> |