Fso asp generates static HTML code

Source: Internet
Author: User

Replacing the template tag when FsO generates a static html file has always been a very troublesome problem. At least I think so. Do not create another template. This is troublesome !, I saw a way to solve this problem today.

Such as a normal index. asp page, and use ASPCodeCall up the content in the database, create a makehtml. ASP page, and add a textarea domain, for example, name = "body". Call index. asp in textarea, for example:
<Textarea name = "body"> <! -- # Include file = "index. asp" --> </textarea>: Include this textareain the table list and create an fsoobject for the receiving table single page. For example, the index.html file is generated!Copy codeThe Code is as follows: <%
Filename = "../index.html"
If request ("body") <> "then
Set FSO = server. Createobject ("scripting. FileSystemObject ")
Set fout = FSO. createtextfile (server. mappath ("" & filename &""))
Fout. Write Request. Form ("body ")
Fout. Close
Set fout = nothing
Set FSO = nothing
End if
%>

The index.html file is generated, and the template is not required. You only need to read the ASP file used normally to textarea. No problem has been found yet! The premise is that the server must support FSO.

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.