Converting ASP to a Static File

Results 1 to 2 of 2

Thread: Converting ASP to a Static File

  1. #1
    Join Date
    Dec 1969

    Default Converting ASP to a Static File

    I would like to capture a "snapshot" of an ASP page for a weekly report so that users access its information from a fixed static file rather than the dynamic ASP page. It is a relatively static ASP page (updates once per week), which I would like to copy over to either a static HTML page or word document after it updates. The only thing I have found to do this is an application called XBuilder but would rather code this procedure myself. Anyone have any ideas? Thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: Converting ASP to a Static File

    You won&#039t code this in ASP.<BR><BR>You could code it in Java fairly easily. Other languages are doable.<BR><BR>You have to *pretend* to be a web browser, ask for the ASP page, and capture the bytes that are sent to you. Strip off header junk and preserve the HTML.<BR><BR>Of course, your other choice is to change how you generate the page. If you create the page using 100% RESPONSE.WRITE (*NO* embedded HTML, at all!), then it&#039s pretty easy to use an editor to change each Response.Write to something like Outfile.Write. Open a text file for output, run that ASP page, and you just wrote the stuff to a text file, which can now become the static HTML page.<BR><BR>Note that if you put in a *tiny* bit more work, you could do something like this:<BR><BR>&#060;%<BR>CONST MakeStatic = False &#039 change to True when ready!<BR>Dim OutFile &#039 opened in mainline code if needed<BR><BR>Sub HTML( msg )<BR> &nbsp; If MakeStatic <BR> &nbsp; &nbsp; &nbsp; OutFile.WriteLine msg<BR> &nbsp; Else<BR> &nbsp; &nbsp; &nbsp; Response.Write msg & vbNewLine<BR> &nbsp; End If<BR>End Sub<BR>%&#062;<BR><BR>And now you simply use <BR> &nbsp; &nbsp; HTML "&#060;TABLE...."<BR>to write out to either place, with the flag dictating which.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts