XML and ASP simple combination implementation HTML template function

xiaoxiao2021-03-06  40

This paper uses XML DSO data binding functions to implement the separation of ASP code and HTML code, thereby implementing the function of fast replacement HTML template. Since I just start contacting XML, there are many don't know much, here is only proposed here. A little idea, if this article has a wrong place, please feel more.

At present, the fast replacement template function is basically after a special label in the Replace Replacement template, which increases many ASP processing times, and if the template file is too long, it is also the server memory when loading into the memory is processed. A test. The XML provides a DSO data binding function. You can deliver the identity replacement operation to the client. Since the HTML template is required. Therefore, try to simplify the XML technical content of the HTML template is necessary. .

Simply, this way is just the properties of the two HTML tags of DataSRC and DataFLD. There is not much disconnection, and all the examples will explain everything.

Example 1: Single data display

The following is the XML data island generated with ASP.

CODER

Light Spiritual Pearl

http://blog.9cbs.net/oyiboy

HTML original code display:

My brief introduction

My Name:

Website Name:

Website address:

Example 2: Multiple Data Display

The following is the XML data island generated with ASP.

Light Spiritual Pearl

http://blog.9cbs.net/oyiboy

EStyle's trivious hand-tie

http://blog.9cbs.net/estyle

Favorite cabbage

http://blog.9cbs.net/qunluo

HTML original code display:

I am concerned with CSDN Blog List

name

address

(The above two examples can view the actual running effect in a file.)

Note that the two HTML origin in the AAD and TBODY are useful when displaying multiple records. If you don't understand what they use, you can see if there is any consequence.

By the way, the data binding and hyperlink binding of the image and buttons is similar, such as: and