Is there any way to generate a normal htmer.asp page directly into an htmer.html page without using a template? Of course it is possible, and it is very simple. Today I will teach you how to generate HTML static pages in ASP without using templates.
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 generate a normal htmer.asp page directly into an htmer.html page without using a template? Of course it is possible, and it is very simple. Today I will teach you how to generate HTML static pages in ASP without templates.
Assume here that there is a htmer.asp dynamic page, and you want to generate it into an HTML static page htmer.html, then we first create a new ASP program file htmer_to_html.asp (this file is used to generate the htmer.asp dynamic page into a static page htmer.html), the specific code of htmer_to_html.asp is as follows:
<form method=post action=><textarea name=asp2html style=display:none><!--#include file=htmer.asp--></textarea><input type=submit value=Generate html page/>< /form><%Dim Filename,Fso,FoutIf Request.Form(asp2html)<> ThenFilename=htmer.htmlSet Fso=Server.CreateObject(Scripting.FileSystemObject)Set Fout=Fso.CreateTextFile(Server.Mappath(Filename))Fout.Write Request.Form(asp2html)Fout.CloseSet Fout=NothingSet Fso=NothingEnd If%>