欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

功能不錯(cuò)的asp模板類代碼附下載第1/4頁

 更新時(shí)間:2008年07月24日 15:06:03   作者:  
在工作中,因?yàn)橐媚0孱?,在網(wǎng)上找了個(gè)asp模板類,用著挺好了。完工后也按別人的思路寫了模板類,這個(gè)模板類沒在設(shè)計(jì)的項(xiàng)目中應(yīng)用,只是練練筆,所以只寫了簡(jiǎn)單的幾個(gè)demo,有沒有bug還不清楚,歡迎大家測(cè)試,指教,幫忙完善。
此類支持循環(huán)替換,支持嵌套循環(huán)替換,支持多模板。 
類的代碼就不貼不來啰嗦了,在后面有下載,只貼出demo的代碼。 

一、模板只有一個(gè)循環(huán)塊 
模板文件主要代碼 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>{myname}模板-{webName}</title> 
</head> 

<body> 
<table width="500" border="0" cellspacing="0" cellpadding="0"> 
<!-- begin a_block --> 
<tr> 
<td width="50" height="30">第一列</td> 
<td width="50" height="30">{tpl_1}</td> 
<td width="50" height="30">{tpl_2}</td> 
</tr> 
<!-- end a_block --> 
</table> 
</body> 
替換模板的代碼
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> 
<!--#include file="tplCls.asp"--> 
<% 
response.Charset="utf-8" 
set newTpl=new tpl 
newTpl.setTpl="tpl.html" 

newTpl.setVar "myname","一個(gè)塊循環(huán)的" 
newTpl.setVar "webName","亮亮的博客" 

newTpl.setBlock="a_block" 
for tt=0 to 2 
newTpl.setBloVar "tpl_1","第二列_"&tt 
newTpl.setBloVar "tpl_2","第三列_"&tt 
newTpl.outBloVar 
next 
newTpl.outBlock "a_block" 

newTpl.out 
set newTpl=nothing
%> 

相關(guān)文章

最新評(píng)論