Ciao, mi potete aiutarmi ad creare una classe per staccare il codice da html.
Il codice e questo:
<%
Class Template
Function GetFileHTML(pFile)
Dim fileObj
Set fileObj = CreateObject("Scripting.FileSystemObject")
fileObj.OpenTextFile(Server.MapPath(pFile))
End Function
function replace_tag(tags)
tags = Replace( tag, "<$" & key & "$>", tags )
End function
End class
%>
ed si usa cosi:
<!-- #include virtual ="/include/template.asp" -->
<%
Dim page : Set page = new Template
page.GetFileHTML("prova.html")
test = "ciao sono test"
page.replace_tag(tags)
%>
ed il file html(prova.html) e cosi:
<html>
<body>
<h2><$test$></h2>
</body>
</html>
Vorrei farlo in un array però non so come si usa.
mi potete aiutarmi?
Però a me non mi funziona .. non da nessun errore ma non stampa nulla come mai?
grazie.
Il codice e questo:
<%
Class Template
Function GetFileHTML(pFile)
Dim fileObj
Set fileObj = CreateObject("Scripting.FileSystemObject")
fileObj.OpenTextFile(Server.MapPath(pFile))
End Function
function replace_tag(tags)
tags = Replace( tag, "<$" & key & "$>", tags )
End function
End class
%>
ed si usa cosi:
<!-- #include virtual ="/include/template.asp" -->
<%
Dim page : Set page = new Template
page.GetFileHTML("prova.html")
test = "ciao sono test"
page.replace_tag(tags)
%>
ed il file html(prova.html) e cosi:
<html>
<body>
<h2><$test$></h2>
</body>
</html>
Vorrei farlo in un array però non so come si usa.
mi potete aiutarmi?
Però a me non mi funziona .. non da nessun errore ma non stampa nulla come mai?
grazie.