ASP 3.0 Advanced Programming (46)

Source: Internet
Author: User
Tags zip
Programming | Advanced table 10-5 HTML elements that support data binding
HTML element
Binding properties
Can more
New data
Can the table
Lattice bindings
Can as
HTML display

A
Href
Not
Not
Not

Applet
PARAM
OK
Not
Not

BUTTON
InnerText and innerHTML
Not
Not
OK

Div
InnerText and innerHTML
Not
Not
OK

FRAME
Src
Not
Not
Not

Iframe
Src
Not
Not
Not

Img
Src
Not
Not
Not

INPUT
Checked
OK
Not
Not

TYPE=CHECKOBX INPUT
Value
OK
Not
Not

Type=hidden INPUT
Vale
OK
Not
Not

Type=label INPUT
Value
OK
Not
Not

Type=password INPUT
Checked
OK
Not
Not

Type=radio INPUT
Value
OK
Not
Not

Type=text LABEL
InnerText and innerHTML
Not
Not
OK

LEGEND
InnerText and innerHTML
Not
Not
Not

MARQUEE
InnerText and innerHTML
Not
Not
OK

OBJECT
Param
OK
Not
Not

SELECT
Selected <OPTION> element text
OK
Not
Not

SPAN
InnerText and innerHTML
Not
Not
OK

TABLE
No
Not
OK
Not

TEXTAREA
Value
OK
Not
Not

2. Single record binding
A single record binding is used to display only a single row of data. For example, consider the following code:
ID: <span datasrc= "#dsoData" datafld= "au_id" ></SPAN><BR>
Name: <span datasrc= "#dsoData" datafld= "au_fname" ></SPAN><BR>
Last Name: <span datasrc= "#dsoData" datafld= "au_lname" ></SPAN><BR>
Phone: <span datasrc= "#dsoData" datafld= "Phone" ></SPAN><BR>
Address £ <span datasrc= "#dsoData" datafld= "Address" ></SPAN><BR>
City: <span datasrc=, "#dsoData" datafld= "City" ></SPAN><BR>
State: <span datasrc= "#dsoData" datafld= "state" ></SPAN><BR>
Zip: <span datasrc= "#dsoData" datafld= "Zip" ></SPAN><BR>
Contact: <span datasrc= "#dsoData" datafld= "contract" ></SPAN><BR>
With a single record binding, each bound HTML element determines the data source (DATASRC) and the bound field (DATAFLD).
The results of the above data binding are shown in Figure 10-5:

Figure 10-5 Results of a single record binding
As a result, this already satisfies the requirements, but because the space is ignored in the HTML document, the data is not arranged neatly. Data binding makes it easy to get data, but it doesn't look very nice. A good way to do this is to use a table to align the data.
<table id= "Tbldata" >
<TR><TD>ID:</TD>
<td><span datasrc= "#dsoData" datafld= "au_id" ></SPAN></TD></TR>
<tr><td>first name:</td>
<td><span datasrc= "#dsoData" datafld= "au_fname" ></SPAN></TD></TR>
<tr><td>last name:</td>
<td><span datasrc= "#dsoData" datafld= "au_lname" ></SPAN></TD></TR>
<TR><TD>Phone:</TD>
<td><span datasrc= "#dsoData" datafld= "Phone" ></SPAN></TD></TR>
<TR><TD>Address:</TD>
<td><span datasrc= "#dsoData" datafld= "Address" ></SPAN></TD></TR>
<TR><TD>City:</TD>
<td><span datasrc= "#dsoData" datafld= "City"

[1] [2] [3] [4] Next page



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.