Discussion Locked

Programatically stores source of ASP pag

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I've created an ASP page. How do I store the generated HTML source by the server to an HTML file? Is there a particular command I can use?

Thanks

Ivan

9 replies

by jscragg

ASP is a translated language, not a compiled language. Therefore, the script is translated into HTML every time the server processes the page.

If you really want to save the HTML page, run the script once in your browser, and choose "View" > "Source" from your browser menu to open a listing of the HTML page in your default text editor. Then save the page.

by ivanheng

I already know about the solution suggested. What I was actually asking is, is there a way I can automatically save it to a file rather than manually clicking View source and save it.

Thanks

by ramkaranr

you can internet explorer object to access the webpage and save method to access the url and save the file

by olivier_de-polignac

You could do the following: instead of using Response.Write statements, create a text file, and use the .Write method on the file object.

Hope this helps,

Olivier.

PS: Here is a little sample code:

Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("c:\testfile.htm", True)
MyFile.Write("This is a test.")
MyFile.Close

by expertpc

Please close this link if it is dead. It brings down the performance capabilities of the web server and database calls. If you are still waiting for an answer.....WOW....you are patient

This discussion is closed to new replies.