Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting dynamic page to static?

Status
Not open for further replies.

Riku

Programmer
Sep 2, 2001
119
Is it possible having ASP running dynamic asp page and creating new page from it which would be static.

I need the prosess to be automatic (not saving the file manually), and process hidden from user.

Opening asp file with openStreemText would not run the asp script or would it? F: Riku Tuominen
riku.tuominen@benchmarking.fi
 
[tt]
Don't think I understand what you're asking...

You want to create a static html page from an .asp page? [sup]

winlogo.gif
cool.gif

maclogo.gif
no.gif

[/sup]​
 
An ASP page is generally called from a remote browserin order to see dynamic content. It sounds as if what your are saying you would like is for a static page to be automatically generated every once in while and allowing users to access that rather than the dynamic page.
Any particular reason you chose ASP?

You could do this more easily with an application language. If you write an executable file or java class you could have it do the work and output the html file (overwriting last weeks version/last hours/whatever). Then you could set it up as a scheduled task to run every however-often.

If you use ASP to do this you will actually have more work because you will either need to:
a) Not allow any user but the local system open the file
b) Convince the local system to not only open the browser at regular intervals, but close it when finished (or you could try to force a refresh on an already open browser and hope no one closes it or sits down and starts surfing the web)

or
a) Write it strictly as a VBScript file and run it as a scheduled program which basically falls under the paragraph about standard application language.


So in answer to your question, yes it can be done.
In answer to a question i would ask from past experience:
Would it be in the top ten ways I would do this? I would have to answer no.

-Tarwn Experts are only people who have realized how much they will never know about a language.
________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
If Riku is up to what I think, it's very slick and there's a technique that makes it all work: Let's say you have a page that displays text from a database. The content doesn't change very often, but the content in the DB is maintained by a content manager through an admin screen (e.g. "help" text, "about" text, etc.). Your objective is to present content without having to hit the database each time the page is served.

Try this: the link to this page is to an ASP page. The ASP page uses the filesystem object to check for the existance of an HTML page with the same name as the asp page. If the corresponding HTML page exists, the script redirects (or even better uses response.transfer) to the HTML page.

If the corresponding HTML page does not exist, then build the needed HTML in a string (see articles about using many response.write versus one large one) and use the filesystem object to create the desired HTML file. Write the string to this file, and after closing it, do a redirect (or transfer) to it.

In your admin screen, when someone changes the content for this (or other pages), use the filesystem object to delete the HTML file derived from the content (this is really only practical for a very small number of pages). This effectively forces the HTML to be rebuilt, on demand, whenever the content changes.

Think of it as "Just-in-time HTML"
 
you need to fetch the url of the page from a com component or XMLHttp and save the source as .htm file from Scripting.FileSystem Object.

Best Regards,

Darpan Kumar Gogia
aviint@yahoo.com
 
I have successfully created a VB.NET program which uses Request.Create(url) and runs on my local PC every day using a scheduler. It 'grabes' the dynamic web pages and saves them on my local PC. Then I have another program which ftps all the files to the web server, again on a scheduled basis.

You can also do this with xmlhttp using VB 6.

You need to have an asp page such as where xxx is a query string reference which you can count around.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top