Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 22nd, 2006, 05:12 PM
Registered User
 
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Generating multiple HTML files

I'm looking to create a number of HTML pages that are the result of specific queries to a database. The database is a directory of individuals and their unit association. A HTML page will be generated for each unit. Is it possible to create a ASP script that generates these HTML files, saves them to a specific directory and then updates(overwrites the file(s)) them on a specific interval(daily basis.)

I'm familiar with most aspects of this inquiry except for how to implement ASP to create, save and overwrite HTML files.

Any help is appreciated.

-Dunpeal

 
Old August 23rd, 2006, 07:42 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Easy enough.

Use your System.IO class and do something like this:

If File.Exists(Server.MapPath("./somepath/file.html")) Then File.Delete(Server.MapPath("./somepath/file.html"))

File.CreateText(Server.MapPath("./somepath/file.html"))

//Write to the text file

That should create an html file for you.

HTH.

"The one language all programmers understand is profanity."
 
Old August 23rd, 2006, 11:48 AM
Registered User
 
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the response. I will give this a whirl. Is it also possible to create a function that resides with in the ASP page that automatically re-creates these pages on a interval basis? Say re-create the pages every day at a specified time.

 
Old August 23rd, 2006, 12:13 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Yes and No. There is no way (that i know of) to have an asp script automatically run at a designated time without setting up some sort of scheduled task on the server. You could, however, just set up a scheduled task to navigate to X url at X time and execute the script.

HTH.

"The one language all programmers understand is profanity."
 
Old August 23rd, 2006, 01:38 PM
Registered User
 
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks again! I've been sucessful in using the FileSystemObject. I will look in to creating a scheduled task to perform the rest of this functionality.

 
Old August 23rd, 2006, 01:53 PM
Registered User
 
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Will this work to schedule a task?

http://www.tele-pro.co.uk/scripts/mi...edule_task.htm


 
Old August 24th, 2006, 07:16 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

That might work but remember, ASP and ASP.NET do not run on the same Thread so, while it is possible to run ASP and ASP.NET in the same application, you can not access session values from .NET in Classic and vice versa. (As well as a multitude of other things.)

Guess the only real way to find out if it will work or not is to test it!

"The one language all programmers understand is profanity."





Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating Excel FIles from resource Files abinashpatra ASP.NET 1.0 and 1.1 Basics 0 July 28th, 2008 02:07 AM
Help on generating HTML table please!! minhnghia XSLT 5 September 2nd, 2007 12:35 PM
XSLT to make multiple hyperlinked HTML files dai.hop XSLT 1 January 11th, 2006 03:05 PM
Generating html tags dynamically sachin lad Servlets 1 April 26th, 2005 05:35 PM
Client Side JavaScript Generating HTML Files interrupt Javascript How-To 1 January 14th, 2005 11:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.