Features a good ASP template class code with download 1th/4 Page _ Application Tips

Source: Internet
Author: User
This class supports circular substitution, supports nested loops substitution, and supports multiple templates.
Class code will not stick to verbose, in the back of the download, only posted the demo code.

One, the template has only one loop block
Template file Main code
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title>{myname} template-{webname}</title>

<body>
<table width= "border=" 0 "cellspacing=" 0 "cellpadding=" 0 ">
<!--begin A_block-->
<tr>
&LT;TD width= "height=" > The first column </td>
&LT;TD width= "height=" >{tpl_1}</td>
&LT;TD width= "height=" >{tpl_2}</td>
</tr>
<!--end A_block-->
</table>
</body>
Replace the code for the template
<% @LANGUAGE = "VBSCRIPT" codepage= "65001"%>
<!--#include file= "tplcls.asp"-->
<%
Response. charset= "Utf-8"
Set Newtpl=new TPL
Newtpl.settpl= "Tpl.html"

Newtpl.setvar "MyName", "one block cycle"
Newtpl.setvar "WebName", "Bright Blog"

newtpl.setblock= "A_block"
For tt=0 to 2
Newtpl.setblovar "Tpl_1", "second column _" &tt
Newtpl.setblovar "Tpl_2", "third column _" &tt
Newtpl.outblovar
Next
Newtpl.outblock "A_block"

Newtpl.out
Set newtpl=nothing
%>

Current 1/4 page 1234 Next read the full text
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.