When we generally generate HTML static pages, we often make a template in advance, and then call the template file when generating. So is there any way to do not use templates, such as a normal htmer.asp page, directly becoming the htmer.html page?
Of course, it is possible, and it is very simple. Today, I will teach you how to generate HTML static pages in ASP without a template.
There is a htmer.asp dynamic page here. You want to generate it as HTML static page htmer.html, then we first create a new ASP program file htmer_to_html.asp (this file is used to give birth to htmer.asp dynamic page into a static page. Htmer.html), the specific code of htmer_to_html.asp is shown below:
<FORM METHOD = Post Action =>
<textarea name = asp2html style = dispave: none> <!-#Include file = htmer.asp-> </textarea>
<input type = submit value = generate HTML page/>
</form>
<%
DIM FILENAME, FSO, FOUT
If request.form (ASP2HTML) <> then
Filename = htmer.html
Set fso = server.createObject (scripting.filesystemObject)
Set fout = fso.createtextFile (server.mappath (filename))
FOUT.WRITE Requst.Form (ASP2HTML)
FOUT.Close
Set fout = nothing
Set fSO = Nothing
End if
%>