Forum Moderators: open

Message Too Old, No Replies

convert asp to html

convert asp html

         

bluesman75

11:29 am on Nov 23, 2007 (gmt 0)

10+ Year Member



Hi to all,

I a have a big problem and I don't know how to solve it..

I have an asp page (that contains some querys to a sql db) and I need to generate an html file (that will be saved in a server folder)that contains the content of the asp page output.

Is there possible?

If yes, is there anyone that could help me?

Thank you very much in advance,

Alex

mattur

8:27 pm on Nov 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ASP can generate a text file (e.g. a static HTML page) using the FileSystemObject (FSO). You may need to check your host supports it and that the account has appropriate write permissions to the relevant directory.

You can write an ASP page using similar code to your existing page, but instead of response.write'ing the data you save the output as a text file using FSO.

You probably won't want to build a massive string of the whole page's HTML, so you could instead have a static HTML page with an include for the data generated from the database. Here you just use FileSystemObject to generate the include file.

Or you could use a template file with delimiter(s) where you want to put the database data. Load the template with FileSystemObject, do a simple string replace swapping the delimiters for the data and then save the whole page using FileSystemObject

Look up FileSystemObject for more info. HTH.