Recommended: ASP displays long numbers with commas The following is the quoted content: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Table 10-5 HTML elements that support data binding
HTML elements
Bind attributes
Can I update it
New data
Can you please
Binding
Can it be
HTML display
A
href
No
No
No
APPLET
PARAM
Can
No
No
BUTTON
innerText and innerHTML
No
No
Can
DIV
innerText and innerHTML
No
No
Can
FRAME
src
No
No
No
IFRAME
src
No
No
No
IMG
src
No
No
No
INPUT
Checked
Can
No
No
TYPE=CHECKOBX INPUT
value
Can
No
No
TYPE=HIDDEN INPUT
vale
Can
No
No
TYPE=LABEL INPUT
value
Can
No
No
TYPE=PASSWORD INPUT
Checked
Can
No
No
TYPE=RADIO INPUT
value
Can
No
No
TYPE=TEXT LABEL
innerText and innerHTML
No
No
Can
LEGEND
innerText and innerHTML
No
No
No
MARQUEE
innerText and innerHTML
No
No
Can
OBJECT
param
Can
No
No
SELECT
Selected <OPTION> element text
Can
No
No
SPAN
innerText and innerHTML
No
No
Can
TABLE
none
No
Can
No
TEXTAREA
value
Can
No
No
2. Single record binding
Single record binding is used in cases where only a single row of data is displayed. For example, consider the following code:
ID: <SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=au_id></SPAN><BR>
First Name: <SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=au_fname></SPAN><BR>
Last Name: <SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=au_lname></SPAN><BR>
Phone: <SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=phone></SPAN><BR>
Address: <SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=address></SPAN><BR>
City: <SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=city></SPAN><BR>
State: <SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=state></SPAN><BR>
Zip: <SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=zip></SPAN><BR>
Contact: <SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=contract></SPAN><BR>
When using a single record binding, each bound HTML element determines the data source (DATASRC) and the bound field (DATAFLD).
The above data binding results
As a result, this already satisfies the requirements, but the data is not arranged neatly due to the neglect of spaces in the HTML document. Data binding makes it easy for us to get data, but it doesn't look too beautiful. A good way is to use tables to align data.
<TABLE ID=tblData>
<TR><TD>ID:</TD>
<TD><SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=au_id></SPAN></TD></TR>
<TR><TD>First Name:</TD>
<TD><SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=au_fname></SPAN></TD></TR>
<TR><TD>Last Name:</TD>
<TD><SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=au_lname></SPAN></TD></TR>
<TR><TD>Phone:</TD>
<TD><SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=phone></SPAN></TD></TR>
<TR><TD>Address:</TD>
<TD><SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=address></SPAN></TD></TR>
<TR><TD>City:</TD>
<TD><SPAN DATASRC=http://www.alixixi.com/Dev/Web/ASP/asp_1/2007/#dsoData DATAFLD=city
Share: ASP 3.0 Advanced Programming (42) 5. Return value processing of function return values is different from that of stored procedure return values, which often leads to confusion. In functions, a Boolean value is often returned to indicate whether the function runs successfully or not. If SomeFunctionName() = True Then' Function success