XML and ASP simple combination implementation HTML template function

xiaoxiao2021-03-06  113

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 shows the following is an XML data island generated by ASP. coder Light spirit free pearl http://blog.9cbs.net/oyiboy

HTML original code:

My brief introduction
My name:
website name:
Website address: < / a>

Example 2: Multi-data display The following is the XML data island generated with ASP. Light Spirit Free Pearl http: // Blog.9cbs.net/oyiboy EStyle (田) 想 扎 扎 http://blog.9cbs.net/estyle Favorite cabbage http://blog.9cbs.net/qunluo

HTML original code:

I am concerned with CSDN Blog List
name address
< / span> (The above two examples can view the actual running effect in a file.) Note that the two HTML original code is the AD and TBODY, which will be used when displaying multiple records. If you don't understand what they use, you can remove them. After seeing what the consequence will be.

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