Programatically stores source of ASP pag
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
Windows Forum
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
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
by ivanheng
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 ivanheng
by expertpc
by ivanheng
by ivanheng
This discussion is closed to new replies.
Sort by Trending